Keywords with same prefix in grammar will cause validation error because langium is not greedy. It will not use the longest match. It use the first match instead. #1650
-
I have a grammar with 3 keywords with the same prefix as shown below:
Then it causes false validation error under keyword How to fix this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @durianwaffle, how did you define your keywords? Can you give a reproducible example? By default, Langium will perform some sorting on the keywords to ensure they appear in the correct order in the lexer definition to ensure that this issue does not appear. |
Beta Was this translation helpful? Give feedback.
Hey @durianwaffle,
how did you define your keywords? Can you give a reproducible example? By default, Langium will perform some sorting on the keywords to ensure they appear in the correct order in the lexer definition to ensure that this issue does not appear.