2 ms·
It does make it a little hard to understand how the parser/ast_builder works. But the rest seems easy enough to understand.
by phire 6mo ago
It does make it a little hard to understand how the parser/ast_builder works.
But the rest seems easy enough to understand.
- fuhsnn 6mo ago> It does make it a little hard to understand Or much easier to backdoor...
- gaigalas 6mo agoThis is a hand-written parser for the shell itself (portable shell parsing portable shell): https://gist.github.com/alganet/23df53c567b8a0bf959ecbc7b68997c0 https://gist.github.com/alganet/23df53c567b8a0bf959ecbc7b689... It's an incomplete idea from around a year ago. The approach taken here (aliases as macro-like evals, AST generation using shell variables) became the backbone for the BNF parser generator. This one is much simpler to understand. Simpler grammars tend to produce parser code that looks more like this one.