The regular parser ignores token.NL/token.COMMENT since the grammar assumes there can be any number of them during parsing. This is actually handled in the driver rather than parser, so when the parser got implemented initially we did not specifically instruct this. But seems like it is now needed.
https://github.com/pantsbuild/pants/blob/aa1d38d4f3b791509bff773a65c2b07490bacad3/src/python/pants/util/enums_test.py#L33-L41
This seem to only cover cases where a standalone match or case is used in a newline fashion:
It does not include re.match() or other variants as far as I can see. The fix is should be really easy, just ignoring those tokens on the recorder.
The regular parser ignores
token.NL/token.COMMENTsince the grammar assumes there can be any number of them during parsing. This is actually handled in the driver rather than parser, so when the parser got implemented initially we did not specifically instruct this. But seems like it is now needed.https://github.com/pantsbuild/pants/blob/aa1d38d4f3b791509bff773a65c2b07490bacad3/src/python/pants/util/enums_test.py#L33-L41
This seem to only cover cases where a standalone
matchorcaseis used in a newline fashion:It does not include
re.match()or other variants as far as I can see. The fix is should be really easy, just ignoring those tokens on the recorder.