Permalink
Please sign in to comment.
Browse files
A different approach to implementing alias.
The previous approach of PushAliasBuffer() only worked for a single alias expansion. Iteration was a problem. Now we hook into ParseSimpleCommand and expand aliases iteratively. We join the expanded aliases with the rest of the *text* from the SimpleCommand, and then pass that into ParseCommand(). I made some comments about the cases that this doesn't handle. And also some notes about how dash and bash do it -- with global variables strewn throughout the parser. (Although I wonder if we could do that with self._Next() ? ) - Add more alias test cases - Factor some free functions out of CommandParser. All unit, spec, and gold tests pass.
- Loading branch information...
Showing
with
457 additions
and 204 deletions.
- +5 −1 core/lexer.py
- +282 −163 osh/cmd_parse.py
- +5 −1 osh/cmd_parse_test.py
- +33 −13 osh/parse_lib.py
- +131 −25 spec/alias.test.sh
- +1 −1 test/spec.sh
Oops, something went wrong.
0 comments on commit
405c32b