Open larsjueljensen opened 6 years ago
Is anyone reading this?
Added a 100 rep bounty on stackoverflow. https://stackoverflow.com/questions/50204380
Hey, have you tried minimizing the grammar to isolate the error?
Unfortunately, grammars can be quite hard to debug, in general!
Copied from https://stackoverflow.com/questions/50204380
Given the following nearley code:
When I run nearley-test to test my compiled parser I get the following results:
Command:
Result:
So far so good, next test:
Result:
It looks like it recognizes the X command twice without the comment, and then once with the comment. This only happens when there are spaces inside the comment, which puzzles me...
Now if i test it with a comment that contains spaces at the end of the line, I get:
Result:
So it seems that the error only happens when I start the line with a comment that contains spaces, which is strange...
Does anyone know what I can do to get a more consistent behaviour? I mean what can I do to make the parser recognize the command and the comment once for each occurence regardless of spaces inside the comment and regardless of the comment is before or after other items on the line?