Repository navigation
Conversation
This can improve grammar source compatibility posix lex. Other lex implementations still generally emit verbatim code in an unreachable area of the generated source. Meaning it is parsed, but not evaluated.
| grammar: | | ||
| %grmtools{ | ||
| yacckind: Original(NoAction), | ||
| ignore_verbatim_code, |
There was a problem hiding this comment.
Definitely something to look into here,
This should be in the lexer, I don't understand yet why it isn't failing when in the grammar.
Alas it also doesn't yet work when moving it into the lexer.
There was a problem hiding this comment.
I just moved that fix/test entirely to the other PR as it probably just belongs there.
|
Possibly dumb question: what counts as verbatim code? Do we hardcode |
The test for verbatim code is whether the line has any leading whitespace. We don't parse any more than that, and we never write it into action code.
So there is no case in which we actually write the verbatim code snippets to action code or parse it beyond the leading space. |
| Start: 'ANY' | 'a' | 'NL'; | ||
|
|
||
| lexer: | | ||
| %grmtools{!dot_matches_new_line, octal, size_limit: 1048576} |
There was a problem hiding this comment.
I should probably remove some of the extra things in this test.
|
Still an issue with this, as it seems to work for Edit: Fixed by f842132 |
Here is a patch for #670
It doesn't quite do what the bug report asks for (ignoring comments or whitespace by default),
but allows a way to disable the error, and mentions that now in the error.
This can improve grammar source compatibility posix lex.
Other lex implementations still generally emit verbatim code in an unreachable area of the generated source. Meaning it is parsed, but not evaluated.
In that bug report we had also discussed a
LexCompatibilityenum, I hadn't implemented that yet.