Closed ipetrushevskiy closed 5 years ago
Could you post a part of grammar with such a warning?
lexer grammar TestExample; fragment BlockValue: ~[:{}]*; BLOCK_VALUE: BlockValue;
Just replace star *
with plus +
to get rid of warnings:
lexer grammar TestExample;
fragment BlockValue: ~[:{}]+;
BLOCK_VALUE: BlockValue;
@ipetrushevskiy That grammar can match an infinite number of BLOCK_VALUE
tokens between any other tokens. The warning needs to be fixed (by ensuring BLOCK_VALUE
always matches at least one character) or the grammar is ambiguous.
Thanks for clarifications.
I have a warning message while building my lexer like: 'warning AC0146: non-fragment lexer rule '' can match the empty string'
I wanted to suppress it with 'ruleset' but I cant as its code 'AC0146' is not correctly passed somehow (looks like empty from VS error list window for example).
Is it any other way to do it?
Thanks in advance.