I want to use some code analysis for the optimizations for a long time, but peg-based parser is not flexible enough for that.
While the long-term plan is to finish rowan parser, I still want to have a faster alternative parser for AST (Rowan is best for CST).
In this PR, I have replaced peg-based parser with nom-based rewrite, and created a prototype analyzer, on which logic the real one will be based.
Commits will be split, some changed will be split into other PRs too, this is just a draft/PoC.
This parser also allows to quickier experimentation on language features, better syntax feature-gating (which was lacking for null-coalesce/destruction), better control over AST structures layout (I like the expression structure from rowan-based parser better, and this PR brings it partially).
Replace string-based input with lexer made for rowan-parser
If is not possible to use lexer from rowan-parser, then try to make Input automatically eat whitespace with mini-lexer (Whitespace handling in this PR is not good)
I want to use some code analysis for the optimizations for a long time, but peg-based parser is not flexible enough for that. While the long-term plan is to finish rowan parser, I still want to have a faster alternative parser for AST (Rowan is best for CST). In this PR, I have replaced peg-based parser with nom-based rewrite, and created a prototype analyzer, on which logic the real one will be based.
Commits will be split, some changed will be split into other PRs too, this is just a draft/PoC.
This parser also allows to quickier experimentation on language features, better syntax feature-gating (which was lacking for null-coalesce/destruction), better control over AST structures layout (I like the expression structure from rowan-based parser better, and this PR brings it partially).
It also implements numberic separators as proposed here: https://github.com/google/jsonnet/issues/1155, but I'll probably port this to peg in the meantime.