Replies: 1 comment 15 replies
-
Looks like you ran into the typical keywords vs identifiers problem. See the documentation or the code example here on how to deal with it. It all comes down to the order of your token types in the lexer definition. |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have defined In keyword "In" with the following pattern
createToken({ name: "In", pattern: /in/ })
when parsing terms that start with a prefix in (ie, inState) , the parser parses in as a keyword.
The solution is to define the pattern with a space following the keyword, like so
createToken({ name: "In", pattern: /in / })
However, it creates some other issues.
Is there any other way to fix this problem?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions