Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Lexer/Parser using pyparsing for lshell #255

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ghantoos
Copy link
Owner

@ghantoos ghantoos commented Dec 13, 2024

Closes: #87

ghantoos and others added 11 commits December 3, 2024 23:11
Current test status:

debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collected 120 items
debian_tests  |
debian_tests  | test/test_builtins.py ...........                                        [  9%]
debian_tests  | test/test_command_execution.py ..............                            [ 20%]
debian_tests  | test/test_completion.py .....                                            [ 25%]
debian_tests  | test/test_config.py .......                                              [ 30%]
debian_tests  | test/test_env_vars.py .......                                            [ 36%]
debian_tests  | test/test_exit.py ..                                                     [ 38%]
debian_tests  | test/test_file_extension.py ...                                          [ 40%]
debian_tests  | test/test_path.py ...FF...                                               [ 47%]
debian_tests  | test/test_ps2.py ..F..                                                   [ 51%]
debian_tests  | test/test_regex.py F..F                                                  [ 55%]
debian_tests  | test/test_scripts.py FF                                                  [ 56%]
debian_tests  | test/test_security.py .FF                                                [ 59%]
debian_tests  | test/test_signals.py .FF.F..FFF                                          [ 67%]
debian_tests  | test/test_ssh.py ...                                                     [ 70%]
debian_tests  | test/test_unit.py ....................................                   [100%]
debian_tests  |
debian_tests  | =========================== short test summary info ============================
debian_tests  | FAILED test/test_path.py::TestFunctions::test_11_etc_passwd_1 - AssertionErro...
debian_tests  | FAILED test/test_path.py::TestFunctions::test_12_etc_passwd_2 - AssertionErro...
debian_tests  | FAILED test/test_ps2.py::TestFunctions::test_65_multi_line_command_security_echo
debian_tests  | FAILED test/test_regex.py::TestFunctions::test_51_grep_valid_log_entry - Asse...
debian_tests  | FAILED test/test_regex.py::TestFunctions::test_54_grep_special_characters_in_uid
debian_tests  | FAILED test/test_scripts.py::TestFunctions::test_39_script_execution_with_template
debian_tests  | FAILED test/test_scripts.py::TestFunctions::test_40_script_execution_with_template_strict
debian_tests  | FAILED test/test_security.py::TestFunctions::test_31_security_echo_freedom_and_help
debian_tests  | FAILED test/test_security.py::TestFunctions::test_32_security_echo_freedom_and_cd
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_28_catch_terminal_ctrl_j - A...
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_29_catch_terminal_ctrl_k - A...
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_72_background_command_with_ampersand
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_75_interrupt_background_commands
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_76_jobs_after_completion - p...
debian_tests  | FAILED test/test_signals.py::TestFunctions::test_77_mix_background_and_foreground
debian_tests  | ================== 15 failed, 105 passed in 63.61s (0:01:03) ===================
Current tests status:

debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collected 120 items
debian_tests  |
debian_tests  | test/test_builtins.py ...........                                        [  9%]
debian_tests  | test/test_command_execution.py ..............                            [ 20%]
debian_tests  | test/test_completion.py .....                                            [ 25%]
debian_tests  | test/test_config.py .......                                              [ 30%]
debian_tests  | test/test_env_vars.py .......                                            [ 36%]
debian_tests  | test/test_exit.py ..                                                     [ 38%]
debian_tests  | test/test_file_extension.py ...                                          [ 40%]
debian_tests  | test/test_path.py ........                                               [ 47%]
debian_tests  | test/test_ps2.py ..F..                                                   [ 51%]
debian_tests  | test/test_regex.py F..F                                                  [ 55%]
debian_tests  | test/test_scripts.py FF                                                  [ 56%]
debian_tests  | test/test_security.py .FF                                                [ 59%]
debian_tests  | test/test_signals.py .FF.F..FFF                                          [ 67%]
debian_tests  | test/test_ssh.py .F.                                                     [ 70%]
debian_tests  | test/test_unit.py ....................................                   [100%]
debian_tests  |
debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collected 120 items
debian_tests  |
debian_tests  | test/test_builtins.py ...........                                        [  9%]
debian_tests  | test/test_command_execution.py ..............                            [ 20%]
debian_tests  | test/test_completion.py .....                                            [ 25%]
debian_tests  | test/test_config.py .......                                              [ 30%]
debian_tests  | test/test_env_vars.py .......                                            [ 36%]
debian_tests  | test/test_exit.py .F                                                     [ 38%]
debian_tests  | test/test_file_extension.py ...                                          [ 40%]
debian_tests  | test/test_path.py ........                                               [ 47%]
debian_tests  | test/test_ps2.py .....                                                   [ 51%]
debian_tests  | test/test_regex.py ....                                                  [ 55%]
debian_tests  | test/test_scripts.py FF                                                  [ 56%]
debian_tests  | test/test_security.py .FF                                                [ 59%]
debian_tests  | test/test_signals.py .FF.F..FFF                                          [ 67%]
debian_tests  | test/test_ssh.py ...                                                     [ 70%]
debian_tests  | test/test_unit.py ....................................                   [100%]
debian_tests  |
debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collected 120 items
debian_tests  |
debian_tests  | test/test_builtins.py ...........                                        [  9%]
debian_tests  | test/test_command_execution.py ..............                            [ 20%]
debian_tests  | test/test_completion.py .....                                            [ 25%]
debian_tests  | test/test_config.py .......                                              [ 30%]
debian_tests  | test/test_env_vars.py .......                                            [ 36%]
debian_tests  | test/test_exit.py ..                                                     [ 38%]
debian_tests  | test/test_file_extension.py ...                                          [ 40%]
debian_tests  | test/test_path.py ........                                               [ 47%]
debian_tests  | test/test_ps2.py .....                                                   [ 51%]
debian_tests  | test/test_regex.py ....                                                  [ 55%]
debian_tests  | test/test_scripts.py ..                                                  [ 56%]
debian_tests  | test/test_security.py .FF                                                [ 59%]
debian_tests  | test/test_signals.py .FF.F..FFF                                          [ 67%]
debian_tests  | test/test_ssh.py ..F                                                     [ 70%]
debian_tests  | test/test_unit.py ....................................                   [100%]
debian_tests  |
debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack -- /usr/bin/python3
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collecting ... collected 3 items
debian_tests  |
debian_tests  | test/test_security.py::TestFunctions::test_27_checksecure_awk PASSED     [ 33%]
debian_tests  | test/test_security.py::TestFunctions::test_31_security_echo_freedom_and_help PASSED [ 66%]
debian_tests  | test/test_security.py::TestFunctions::test_32_security_echo_freedom_and_cd PASSED [100%]
debian_tests  |
debian_tests  | ============================== 3 passed in 1.72s ===============================
debian_tests  |
debian_tests  | ------------------------------------
debian_tests  | Your code has been rated at 10.00/10
debian_tests  |
debian_tests exited with code 0
debian_tests  | ============================= test session starts ==============================
debian_tests  | platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
debian_tests  | cachedir: /tmp/.lshell_pytest_cache
debian_tests  | rootdir: /home/testuser/lshell, configfile: pytest.ini
debian_tests  | collected 120 items
debian_tests  |
debian_tests  | test/test_builtins.py ...........                                        [  9%]
debian_tests  | test/test_command_execution.py ..............                            [ 20%]
debian_tests  | test/test_completion.py .....                                            [ 25%]
debian_tests  | test/test_config.py .......                                              [ 30%]
debian_tests  | test/test_env_vars.py .......                                            [ 36%]
debian_tests  | test/test_exit.py ..                                                     [ 38%]
debian_tests  | test/test_file_extension.py ...                                          [ 40%]
debian_tests  | test/test_path.py ........                                               [ 47%]
debian_tests  | test/test_ps2.py .....                                                   [ 51%]
debian_tests  | test/test_regex.py ....                                                  [ 55%]
debian_tests  | test/test_scripts.py ..                                                  [ 56%]
debian_tests  | test/test_security.py ...                                                [ 59%]
debian_tests  | test/test_signals.py ..........                                          [ 67%]
debian_tests  | test/test_ssh.py ...                                                     [ 70%]
debian_tests  | test/test_unit.py ....................................                   [100%]
debian_tests  |
debian_tests  | ============================= 120 passed in 45.58s =============================
debian_tests  |
debian_tests  | ------------------------------------
debian_tests  | Your code has been rated at 10.00/10
debian_tests  |
debian_tests exited with code 0
@ghantoos
Copy link
Owner Author

@omega8cc if by any chance you are able to test this change, it would be awesome! It's a rather big change to add a proper lexer/parser to lshell. Let me know if you have any questions. No worries if you can't. Thanks!

@omega8cc
Copy link
Contributor

We will test this out and report back, thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have proper Lexer/Parser
2 participants