lark icon indicating copy to clipboard operation
lark copied to clipboard

Provide line numbers for "Unused rule" and "Unused terminals"

Open charles-esterbrook opened this issue 5 years ago • 0 comments
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.

charles-esterbrook avatar Nov 02 '20 03:11 charles-esterbrook