Merge pull request #2373 from renatahodovan/parser-import

[Python3] Fix the import of parser superclasses.
This commit is contained in:
Terence Parr 2018-10-08 12:35:48 -07:00 committed by GitHub
commit 03a0a40835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -119,7 +119,10 @@ Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
<if(superClass)>
from .<superClass> import <superClass>
if __name__ is not None and "." in __name__:
from .<superClass> import <superClass>
else:
from <superClass> import <superClass>
<endif>
<atn>