Skip to content

Commit f65bf3f

Browse files
committed
[refactor] fix imports of asjson() and related
1 parent 6119fd3 commit f65bf3f

File tree

12 files changed

+12
-14
lines changed

12 files changed

+12
-14
lines changed

docs/models.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Viewing Models as JSON
5252

5353

5454
Models generated by |TatSu| can be viewed by converting them to a JSON-compatible structure
55-
with the help of ``tatsu.util.asjson.asjson()``. The protocol tries to provide the best
55+
with the help of ``tatsu.util.asjson()``. The protocol tries to provide the best
5656
representation for common types, and can handle any type using ``repr()``. There are provisions for structures with back-references, so there's no infinite recursion.
5757

5858
.. code:: python

tatsu/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import operator
55
from functools import reduce
66

7-
from tatsu.util.asjson import asjson
7+
from tatsu.util import asjson
88

99
from .util import is_list
1010

tatsu/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ def main(filename, **kwargs):
11271127

11281128
if __name__ == '__main__':
11291129
import json
1130-
from tatsu.util.asjson import asjson
1130+
from tatsu.util import asjson
11311131

11321132
ast = generic_main(main, EBNFBootstrapParser, name='EBNFBootstrap')
11331133
data = asjson(ast)

tatsu/codegen/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def main(filename, **kwargs):
583583
584584
if __name__ == '__main__':
585585
import json
586-
from tatsu.util.asjson import asjson
586+
from tatsu.util import asjson
587587
588588
ast = generic_main(main, {name}Parser, name='{name}')
589589
data = asjson(ast)

tatsu/ngcodegen/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def main(filename, **kwargs):
5353
5454
if __name__ == '__main__':
5555
import json
56-
from tatsu.util.asjson import asjson
56+
from tatsu.util import asjson
5757
5858
ast = generic_main(main, {name}Parser, name='{name}')
5959
data = asjson(ast)

tatsu/objectmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from dataclasses import dataclass
66
from typing import Any
77

8-
from tatsu.util.asjson import AsJSONMixin, asjson, asjsons
8+
from tatsu.util import AsJSONMixin, asjson, asjsons
99

1010
from .ast import AST
1111
from .infos import CommentInfo, ParseInfo

tatsu/symtables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import defaultdict
77
from copy import copy
88

9-
from tatsu.util.asjson import asjson
9+
from tatsu.util import asjson
1010

1111
from .exceptions import ParseException
1212
from .infos import LineIndexInfo

tatsu/tool.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
import sys
1212
from pathlib import Path
1313

14-
from tatsu.parserconfig import ParserConfig
15-
1614
from ._version import __version__
1715
from .exceptions import ParseException
1816
from .ngcodegen import codegen as ngpythoncg
1917
from .ngcodegen import objectmodel as ngobjectmodel
2018
from .parser import GrammarGenerator
19+
from .parserconfig import ParserConfig
2120
from .semantics import ModelBuilderSemantics
2221
from .util import eval_escapes
2322

test/parsing_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import tatsu
77
from tatsu.parser import EBNFBuffer
8-
from tatsu.util import eval_escapes, trim
9-
from tatsu.util.asjson import asjson
8+
from tatsu.util import asjson, eval_escapes, trim
109

1110

1211
class MockIncludeBuffer(EBNFBuffer):

test/pickle_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from tatsu.semantics import ModelBuilderSemantics
44
from tatsu.tool import compile
5-
from tatsu.util.asjson import asjson
5+
from tatsu.util import asjson
66

77

88
def test_synth_model():

0 commit comments

Comments
 (0)