Strange/wrong error message? Need help! #640
-
Hey guys! So, I'm trying to use Langium for the first time with a formal grammar that is tried and true for years now (using a different parser). This part shouldn't be the problem here, But Langium behaves differently than I expected, so could someone shed some light on what I'm doing wrong here: I have distilled the problem down to this language definition (plus the white-space and comment hidden terminals):
So any strings that start with "@" then some text, then "#" and then some (positive) number should be fine. But the following example isn't parsed:
with the error:
Any ideas where I went wrong here? This isn't my first rodeo with formal grammars or parsers. But even though I've read most of the Langium documentation (at least all the grammar parts) I can't figure out myself what I'm doing wrong here. Even turning Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Sounds a lot like this. Maybe flipping the order of your terminal rules will fix it. @msujew will know for sure. |
Beta Was this translation helpful? Give feedback.
-
Overlapping terminal rules should be avoided according to #365 (reply in thread), and replace the definition of
should resolve the problem. |
Beta Was this translation helpful? Give feedback.
Overlapping terminal rules should be avoided according to #365 (reply in thread), and replace the definition of
FIELD
withshould resolve the problem.