Closed laowantong closed 1 year ago
These are parts of the code that never actually run. They are copied over from the Lark library along with chunks that do run.
Ideally we should produce a standalone without any unknown symbols, I guess no one cared enough so far to fix it.
(InteractiveParser should be available in standalone, I think?)
Thanks for the explanation. Indeed, I have not encountered any case in which this dead code has caused problems.
One more nitpick though: I initially thought that the issue was solved (since you closed it as "completed", instead of "not planned"), but the file generated by Lark v1.1.7 still presents the same issue.
PS: I don't know about InteractiveParser
, but I can confirm that PyLance doesn't know how to resolve it.
When I open a generated stand-alone parser, VSCode marks quite a few identifiers as unknown, e.g.,
.lexer
,InteractiveParser
,_serialize
,Enumerator
, etc.Are they somehow dynamically resolved during execution?