[Python] Add missing lexer super class imports.
Although, both lexer and parser grammars can have a custom super class set, but only the generated parser sources were prepared to import these classes. The patch makes custom lexer ancestor classes imported, too.
This commit is contained in:
parent
432022fc1c
commit
301ac82631
|
@ -749,6 +749,10 @@ import sys
|
|||
>>
|
||||
|
||||
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
|
||||
<if(superClass)>
|
||||
from .<superClass> import <superClass>
|
||||
|
||||
<endif>
|
||||
|
||||
<atn>
|
||||
|
||||
|
|
|
@ -756,7 +756,13 @@ import sys
|
|||
>>
|
||||
|
||||
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
|
||||
<if(superClass)>
|
||||
if __name__ is not None and "." in __name__:
|
||||
from .<superClass> import <superClass>
|
||||
else:
|
||||
from <superClass> import <superClass>
|
||||
|
||||
<endif>
|
||||
<atn>
|
||||
|
||||
class <lexer.name>(<if(superClass)><superClass><else>Lexer<endif>):
|
||||
|
|
Loading…
Reference in New Issue