forked from jasder/antlr
Changed Python runtime Lexer.py, Parser.py to support version > 5
This commit is contained in:
parent
9e64dfc6e9
commit
5ec39c2a65
|
@ -263,3 +263,4 @@ YYYY/MM/DD, github id, Full name, email
|
||||||
2020/09/15, rmcgregor1990, Robert McGregor, rmcgregor1990@gmail.com
|
2020/09/15, rmcgregor1990, Robert McGregor, rmcgregor1990@gmail.com
|
||||||
2020/09/16, trenki2, Markus Trenkwalder, trenki2[at]gmx[dot]net
|
2020/09/16, trenki2, Markus Trenkwalder, trenki2[at]gmx[dot]net
|
||||||
2020/10/08, Marti2203, Martin Mirchev, mirchevmartin2203@gmail.com
|
2020/10/08, Marti2203, Martin Mirchev, mirchevmartin2203@gmail.com
|
||||||
|
2020/10/11, cliid, Jiwu Jang, jiwujang@naver.com
|
|
@ -9,8 +9,12 @@
|
||||||
# of speed.
|
# of speed.
|
||||||
#/
|
#/
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from typing.io import TextIO
|
|
||||||
import sys
|
import sys
|
||||||
|
if sys.version_info[1] > 5:
|
||||||
|
from typing import TextIO
|
||||||
|
else:
|
||||||
|
from typing.io import TextIO
|
||||||
from antlr4.CommonTokenFactory import CommonTokenFactory
|
from antlr4.CommonTokenFactory import CommonTokenFactory
|
||||||
from antlr4.atn.LexerATNSimulator import LexerATNSimulator
|
from antlr4.atn.LexerATNSimulator import LexerATNSimulator
|
||||||
from antlr4.InputStream import InputStream
|
from antlr4.InputStream import InputStream
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
# Use of this file is governed by the BSD 3-clause license that
|
# Use of this file is governed by the BSD 3-clause license that
|
||||||
# can be found in the LICENSE.txt file in the project root.
|
# can be found in the LICENSE.txt file in the project root.
|
||||||
import sys
|
import sys
|
||||||
|
if sys.version_info[1] > 5:
|
||||||
|
from typing import TextIO
|
||||||
|
else:
|
||||||
from typing.io import TextIO
|
from typing.io import TextIO
|
||||||
from antlr4.BufferedTokenStream import TokenStream
|
from antlr4.BufferedTokenStream import TokenStream
|
||||||
from antlr4.CommonTokenFactory import TokenFactory
|
from antlr4.CommonTokenFactory import TokenFactory
|
||||||
|
|
Loading…
Reference in New Issue