Parser Refactoring, Unit Tests Added, & New Features #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactoring
This will primarily refactor all the parsing-related content into a new parser module. The pipeline parsing logic was removed from the peg module and placed into it's own module.
Unit Tests
Unit tests were added for the new
for
grammar and statement splitter, so there's more coverage now. A number of tests were removed for the pipleline logic as it's no valid since landing the statement splitter.StatementSplitter Improvements
The statement splitter was improved to now ignore comments, as it should. The following command:
Will thus split into:
(Seems highlight.js doesn't properly parse comments)
The statement splitter is now also integrated with the rest of the shell's functionality (scripts, init script, source, etc.) instead of just the REPL shell alone.
Process Recursion
It's now possible to perform process recursion, like so:
Context History Improvement
In addition, a small change was appended that improves the usefulness of navigating history when a previous command contained multiple statements, which also disables the context history for commands executed via scripts (as other shells do it).