lark
lark copied to clipboard
Provide line numbers for "Unused rule" and "Unused terminals"
trafficstars
Suggestion Example current output:
DEBUG:lark:Unused rule: <__eval_input_star_1 : _NEWLINE>
Unused rule: <__eval_input_star_1 : __eval_input_star_1 _NEWLINE>
DEBUG:lark:Unused rule: <__eval_input_star_1 : __eval_input_star_1 _NEWLINE>
Unused terminals: ['EXPECTED_ERROR']
DEBUG:lark:Unused terminals: ['EXPECTED_ERROR']
This is nice. Additionally, I would like to know the line number in the foo.lark grammar file where the unused rule or token appears.
Describe alternatives you've considered N/A
Additional context This is from the new "unused" warnings printed to the DEBUG log, in Lark 0.10.