Description
I completed all features discussed so far. From this point on, I think I only do bug fixes, source code improvement and refactors and add more tests.
Please open an issue if you find some feature is missing, otherwise, I plan to add specific bash extension to the grammar in a future release.
I wrote a document of implemented options and another one that document the AST.
I think I would refactor the AST node type names to be CamelCased, so they will become:
- CompleteCommand
- Pipeline
- AndOr
- SimpleCommand
- Function
- Name
- CompoundList
- Subshell
- Case
- CaseItem
- If
- While
- Until
- Word
- AssignmentWord
- ArithmeticExpansion
- CommandExpansion
- ParameterExpansion
- IoRedirect
This should be in line with how typical js AST nodes are named.
Also, @wooorm suggested following changes:
and_or > LogicalOperator
simple_command > BuiltIn
io_redirect > Redirect
complete_command > Root
If anyone has other suggestions, please let me know...
I also wrote an AST tree traverser to help implement the visitor pattern, and I think I'll write a web page to parse source code online and show the resulting AST tree.