|
|
@@ -46,8 +46,8 @@ from lark.parsers.lalr_analysis import Shift, Reduce |
|
|
|
|
|
|
|
from ..grammar import Rule |
|
|
|
|
|
|
|
__dir__ = path.dirname(__file__) |
|
|
|
__larkdir__ = path.join(__dir__, path.pardir) |
|
|
|
_dir = path.dirname(__file__) |
|
|
|
_larkdir = path.join(_dir, path.pardir) |
|
|
|
|
|
|
|
|
|
|
|
EXTRACT_STANDALONE_FILES = [ |
|
|
@@ -177,10 +177,10 @@ def main(fobj, start): |
|
|
|
print('# The file was automatically generated by Lark v%s' % lark.__version__) |
|
|
|
|
|
|
|
for pyfile in EXTRACT_STANDALONE_FILES: |
|
|
|
with open(os.path.join(__larkdir__, pyfile)) as f: |
|
|
|
with open(os.path.join(_larkdir, pyfile)) as f: |
|
|
|
print (extract_sections(f)['standalone']) |
|
|
|
|
|
|
|
with open(os.path.join(__larkdir__, 'grammar.py')) as grammar_py: |
|
|
|
with open(os.path.join(_larkdir, 'grammar.py')) as grammar_py: |
|
|
|
print(grammar_py.read()) |
|
|
|
|
|
|
|
print('Shift = 0') |
|
|
|