WIP: nearley parser for the expression language #50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nearley_parse"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The latest in the series that started with #47 and #49, this time exploring the nearley parser, which appears fairly fast and in tests in #49, pretty lightweight.
Work on this PR is starting with a rule-based Tokenizr lexer. The Tokenizr package is quite powerful, so in this iteration I am putting a lot more detail into the lexing: it will handle bracket pairing so it can do the newline-ignoring inside nested expressions and report mismatched brackets even before parsing; it is fully parsing string tokens; it is annotating following tokens with comments that appear before them, etc. (The direction of comment-annotation is not always correct of course; people often comment what's just before. But moving comments into token annotations is much easier to the right than to the left!)
So hopefully with this much more powerful lexing phase, the grammar/parsing will be significantly clearer/easier/more concise.
Update: nearley has some long-unmerged PRs that would be useful in completing this project, revealing that its state of being "maintained" has deteriorated. @josdejong and I are consulting about what the trajectory here should be in light of this observation.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.