Closed lppedd closed 7 months ago
Evaluating a different approach to optimize speed on slower platforms like JS.
@piacenti have a look at this PR. Let me know if it looks good.
You should now be able to also use var
and val
as parser rule names.
Looks good to me, I would just revise the list of keywords as per my comment
A Kotlin enum has a built-in name property, which might conflict with a parser rule named "name".
~Capitalizing generated enum names for the parser's
Rules
enum solves the issue in an elegant way.~This fixes this issue and any related issues by replacing the enums with objects containing const values.
Const values are inlined at compile time, providing a general performance boost while parsing, especially in JS.
cc @ftomassetti
Closes: #145