omlish 0.0.0.dev424__py3-none-any.whl → 0.0.0.dev426__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. omlish/__about__.py +3 -3
  2. omlish/c3.py +4 -1
  3. omlish/configs/processing/flattening.py +1 -1
  4. omlish/configs/processing/merging.py +8 -6
  5. omlish/dataclasses/impl/concerns/doc.py +1 -1
  6. omlish/dataclasses/impl/configs.py +2 -1
  7. omlish/diag/_pycharm/runhack.py +1 -1
  8. omlish/diag/procfs.py +2 -2
  9. omlish/formats/json/stream/lexing.py +69 -14
  10. omlish/formats/json/stream/parsing.py +1 -1
  11. omlish/formats/json/stream/utils.py +3 -0
  12. omlish/formats/json5/streams.py +22 -0
  13. omlish/formats/logfmt.py +8 -2
  14. omlish/funcs/genmachine.py +1 -1
  15. omlish/http/sse.py +1 -1
  16. omlish/inject/impl/injector.py +1 -1
  17. omlish/inject/impl/multis.py +2 -2
  18. omlish/inject/impl/providers.py +0 -4
  19. omlish/inject/impl/proxy.py +0 -2
  20. omlish/inject/scopes.py +0 -4
  21. omlish/io/buffers.py +1 -1
  22. omlish/lang/__init__.py +26 -14
  23. omlish/lang/asyncs.py +12 -0
  24. omlish/lang/{attrs.py → attrstorage.py} +15 -15
  25. omlish/lang/cached/property.py +2 -2
  26. omlish/lang/classes/simple.py +26 -4
  27. omlish/lang/collections.py +1 -1
  28. omlish/lang/functions.py +0 -11
  29. omlish/lang/iterables.py +2 -2
  30. omlish/lang/lazyglobals.py +27 -5
  31. omlish/lang/maysync.py +2 -2
  32. omlish/lifecycles/contextmanagers.py +1 -2
  33. omlish/lifecycles/controller.py +1 -2
  34. omlish/lite/asyncs.py +20 -0
  35. omlish/lite/attrops.py +332 -0
  36. omlish/lite/cached.py +1 -1
  37. omlish/lite/maybes.py +2 -0
  38. omlish/lite/strings.py +0 -7
  39. omlish/lite/timing.py +6 -3
  40. omlish/logs/all.py +25 -32
  41. omlish/logs/base.py +248 -0
  42. omlish/logs/callers.py +21 -15
  43. omlish/logs/infos.py +105 -0
  44. omlish/logs/levels.py +64 -0
  45. omlish/logs/modules.py +10 -0
  46. omlish/logs/protocols.py +31 -0
  47. omlish/logs/standard.py +12 -11
  48. omlish/logs/std/adapters.py +41 -0
  49. omlish/logs/std/configs.py +29 -0
  50. omlish/logs/{filters.py → std/filters.py} +1 -1
  51. omlish/logs/{handlers.py → std/handlers.py} +1 -1
  52. omlish/logs/{json.py → std/json.py} +2 -2
  53. omlish/logs/{proxy.py → std/proxy.py} +3 -3
  54. omlish/logs/std/records.py +286 -0
  55. omlish/logs/times.py +86 -0
  56. omlish/logs/typed/bindings.py +24 -0
  57. omlish/logs/utils.py +60 -4
  58. omlish/logs/warnings.py +8 -0
  59. omlish/manifests/loading.py +1 -1
  60. omlish/os/atomics.py +1 -1
  61. omlish/os/journald.py +3 -3
  62. omlish/reflect/types.py +22 -0
  63. omlish/testing/pytest/plugins/skips.py +0 -4
  64. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/METADATA +2 -2
  65. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/RECORD +72 -114
  66. omlish/defs.py +0 -216
  67. omlish/dispatch/_dispatch2.py +0 -69
  68. omlish/dispatch/_dispatch3.py +0 -108
  69. omlish/dynamic.py +0 -219
  70. omlish/formats/json/Json.g4 +0 -77
  71. omlish/formats/json/_antlr/JsonLexer.py +0 -109
  72. omlish/formats/json/_antlr/JsonListener.py +0 -61
  73. omlish/formats/json/_antlr/JsonParser.py +0 -457
  74. omlish/formats/json/_antlr/JsonVisitor.py +0 -42
  75. omlish/io/trampoline.py +0 -289
  76. omlish/lite/logs.py +0 -4
  77. omlish/lite/reprs.py +0 -85
  78. omlish/logs/abc.py +0 -319
  79. omlish/logs/color.py +0 -27
  80. omlish/logs/configs.py +0 -29
  81. omlish/logs/protocol.py +0 -218
  82. omlish/logs/timing.py +0 -58
  83. omlish/specs/irc/__init__.py +0 -0
  84. omlish/specs/irc/messages/__init__.py +0 -0
  85. omlish/specs/irc/messages/base.py +0 -49
  86. omlish/specs/irc/messages/formats.py +0 -92
  87. omlish/specs/irc/messages/messages.py +0 -774
  88. omlish/specs/irc/messages/parsing.py +0 -98
  89. omlish/specs/irc/numerics/__init__.py +0 -0
  90. omlish/specs/irc/numerics/formats.py +0 -97
  91. omlish/specs/irc/numerics/numerics.py +0 -865
  92. omlish/specs/irc/numerics/types.py +0 -59
  93. omlish/specs/irc/protocol/LICENSE +0 -11
  94. omlish/specs/irc/protocol/__init__.py +0 -61
  95. omlish/specs/irc/protocol/consts.py +0 -6
  96. omlish/specs/irc/protocol/errors.py +0 -30
  97. omlish/specs/irc/protocol/message.py +0 -21
  98. omlish/specs/irc/protocol/nuh.py +0 -55
  99. omlish/specs/irc/protocol/parsing.py +0 -158
  100. omlish/specs/irc/protocol/rendering.py +0 -153
  101. omlish/specs/irc/protocol/tags.py +0 -102
  102. omlish/specs/irc/protocol/utils.py +0 -30
  103. omlish/specs/proto/Protobuf3.g4 +0 -396
  104. omlish/specs/proto/__init__.py +0 -0
  105. omlish/specs/proto/_antlr/Protobuf3Lexer.py +0 -340
  106. omlish/specs/proto/_antlr/Protobuf3Listener.py +0 -448
  107. omlish/specs/proto/_antlr/Protobuf3Parser.py +0 -3909
  108. omlish/specs/proto/_antlr/Protobuf3Visitor.py +0 -257
  109. omlish/specs/proto/_antlr/__init__.py +0 -0
  110. omlish/specs/proto/nodes.py +0 -54
  111. omlish/specs/proto/parsing.py +0 -97
  112. omlish/sql/parsing/Minisql.g4 +0 -292
  113. omlish/sql/parsing/__init__.py +0 -0
  114. omlish/sql/parsing/_antlr/MinisqlLexer.py +0 -322
  115. omlish/sql/parsing/_antlr/MinisqlListener.py +0 -511
  116. omlish/sql/parsing/_antlr/MinisqlParser.py +0 -3763
  117. omlish/sql/parsing/_antlr/MinisqlVisitor.py +0 -292
  118. omlish/sql/parsing/_antlr/__init__.py +0 -0
  119. omlish/sql/parsing/parsing.py +0 -119
  120. /omlish/{.manifests.json → .omlish-manifests.json} +0 -0
  121. /omlish/{formats/json/_antlr → logs/std}/__init__.py +0 -0
  122. /omlish/logs/{noisy.py → std/noisy.py} +0 -0
  123. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/WHEEL +0 -0
  124. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/entry_points.txt +0 -0
  125. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/licenses/LICENSE +0 -0
  126. {omlish-0.0.0.dev424.dist-info → omlish-0.0.0.dev426.dist-info}/top_level.txt +0 -0
@@ -1,109 +0,0 @@
1
- # type: ignore
2
- # ruff: noqa
3
- # flake8: noqa
4
- # @omlish-generated
5
- # Generated from Json.g4 by ANTLR 4.13.2
6
- from ....text.antlr._runtime._all import *
7
- from io import StringIO
8
- import sys
9
- if sys.version_info[1] > 5:
10
- from typing import TextIO
11
- else:
12
- from typing.io import TextIO
13
-
14
-
15
- def serializedATN():
16
- return [
17
- 4,0,12,131,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,
18
- 2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,
19
- 13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,1,0,1,0,1,1,1,1,
20
- 1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,
21
- 1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,5,9,69,8,9,10,9,12,9,
22
- 72,9,9,1,9,1,9,1,10,1,10,1,10,3,10,79,8,10,1,11,1,11,1,11,1,11,1,
23
- 11,1,11,1,12,1,12,1,13,1,13,1,14,3,14,92,8,14,1,14,1,14,1,14,4,14,
24
- 97,8,14,11,14,12,14,98,3,14,101,8,14,1,14,3,14,104,8,14,1,15,1,15,
25
- 1,15,5,15,109,8,15,10,15,12,15,112,9,15,3,15,114,8,15,1,16,1,16,
26
- 3,16,118,8,16,1,16,4,16,121,8,16,11,16,12,16,122,1,17,4,17,126,8,
27
- 17,11,17,12,17,127,1,17,1,17,0,0,18,1,1,3,2,5,3,7,4,9,5,11,6,13,
28
- 7,15,8,17,9,19,10,21,0,23,0,25,0,27,0,29,11,31,0,33,0,35,12,1,0,
29
- 8,8,0,34,34,47,47,92,92,98,98,102,102,110,110,114,114,116,116,3,
30
- 0,48,57,65,70,97,102,3,0,0,31,34,34,92,92,1,0,48,57,1,0,49,57,2,
31
- 0,69,69,101,101,2,0,43,43,45,45,3,0,9,10,13,13,32,32,136,0,1,1,0,
32
- 0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,
33
- 0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,29,1,0,0,0,
34
- 0,35,1,0,0,0,1,37,1,0,0,0,3,39,1,0,0,0,5,41,1,0,0,0,7,43,1,0,0,0,
35
- 9,45,1,0,0,0,11,47,1,0,0,0,13,49,1,0,0,0,15,54,1,0,0,0,17,60,1,0,
36
- 0,0,19,65,1,0,0,0,21,75,1,0,0,0,23,80,1,0,0,0,25,86,1,0,0,0,27,88,
37
- 1,0,0,0,29,91,1,0,0,0,31,113,1,0,0,0,33,115,1,0,0,0,35,125,1,0,0,
38
- 0,37,38,5,123,0,0,38,2,1,0,0,0,39,40,5,44,0,0,40,4,1,0,0,0,41,42,
39
- 5,125,0,0,42,6,1,0,0,0,43,44,5,58,0,0,44,8,1,0,0,0,45,46,5,91,0,
40
- 0,46,10,1,0,0,0,47,48,5,93,0,0,48,12,1,0,0,0,49,50,5,116,0,0,50,
41
- 51,5,114,0,0,51,52,5,117,0,0,52,53,5,101,0,0,53,14,1,0,0,0,54,55,
42
- 5,102,0,0,55,56,5,97,0,0,56,57,5,108,0,0,57,58,5,115,0,0,58,59,5,
43
- 101,0,0,59,16,1,0,0,0,60,61,5,110,0,0,61,62,5,117,0,0,62,63,5,108,
44
- 0,0,63,64,5,108,0,0,64,18,1,0,0,0,65,70,5,34,0,0,66,69,3,21,10,0,
45
- 67,69,3,27,13,0,68,66,1,0,0,0,68,67,1,0,0,0,69,72,1,0,0,0,70,68,
46
- 1,0,0,0,70,71,1,0,0,0,71,73,1,0,0,0,72,70,1,0,0,0,73,74,5,34,0,0,
47
- 74,20,1,0,0,0,75,78,5,92,0,0,76,79,7,0,0,0,77,79,3,23,11,0,78,76,
48
- 1,0,0,0,78,77,1,0,0,0,79,22,1,0,0,0,80,81,5,117,0,0,81,82,3,25,12,
49
- 0,82,83,3,25,12,0,83,84,3,25,12,0,84,85,3,25,12,0,85,24,1,0,0,0,
50
- 86,87,7,1,0,0,87,26,1,0,0,0,88,89,8,2,0,0,89,28,1,0,0,0,90,92,5,
51
- 45,0,0,91,90,1,0,0,0,91,92,1,0,0,0,92,93,1,0,0,0,93,100,3,31,15,
52
- 0,94,96,5,46,0,0,95,97,7,3,0,0,96,95,1,0,0,0,97,98,1,0,0,0,98,96,
53
- 1,0,0,0,98,99,1,0,0,0,99,101,1,0,0,0,100,94,1,0,0,0,100,101,1,0,
54
- 0,0,101,103,1,0,0,0,102,104,3,33,16,0,103,102,1,0,0,0,103,104,1,
55
- 0,0,0,104,30,1,0,0,0,105,114,5,48,0,0,106,110,7,4,0,0,107,109,7,
56
- 3,0,0,108,107,1,0,0,0,109,112,1,0,0,0,110,108,1,0,0,0,110,111,1,
57
- 0,0,0,111,114,1,0,0,0,112,110,1,0,0,0,113,105,1,0,0,0,113,106,1,
58
- 0,0,0,114,32,1,0,0,0,115,117,7,5,0,0,116,118,7,6,0,0,117,116,1,0,
59
- 0,0,117,118,1,0,0,0,118,120,1,0,0,0,119,121,7,3,0,0,120,119,1,0,
60
- 0,0,121,122,1,0,0,0,122,120,1,0,0,0,122,123,1,0,0,0,123,34,1,0,0,
61
- 0,124,126,7,7,0,0,125,124,1,0,0,0,126,127,1,0,0,0,127,125,1,0,0,
62
- 0,127,128,1,0,0,0,128,129,1,0,0,0,129,130,6,17,0,0,130,36,1,0,0,
63
- 0,13,0,68,70,78,91,98,100,103,110,113,117,122,127,1,6,0,0
64
- ]
65
-
66
- class JsonLexer(Lexer):
67
-
68
- atn = ATNDeserializer().deserialize(serializedATN())
69
-
70
- decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
71
-
72
- T__0 = 1
73
- T__1 = 2
74
- T__2 = 3
75
- T__3 = 4
76
- T__4 = 5
77
- T__5 = 6
78
- T__6 = 7
79
- T__7 = 8
80
- T__8 = 9
81
- STRING = 10
82
- NUMBER = 11
83
- WS = 12
84
-
85
- channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
86
-
87
- modeNames = [ "DEFAULT_MODE" ]
88
-
89
- literalNames = [ "<INVALID>",
90
- "'{'", "','", "'}'", "':'", "'['", "']'", "'true'", "'false'",
91
- "'null'" ]
92
-
93
- symbolicNames = [ "<INVALID>",
94
- "STRING", "NUMBER", "WS" ]
95
-
96
- ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
97
- "T__7", "T__8", "STRING", "ESC", "UNICODE", "HEX", "SAFECODEPOINT",
98
- "NUMBER", "INT", "EXP", "WS" ]
99
-
100
- grammarFileName = "Json.g4"
101
-
102
- def __init__(self, input=None, output:TextIO = sys.stdout):
103
- super().__init__(input, output)
104
- self.checkVersion("4.13.2")
105
- self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
106
- self._actions = None
107
- self._predicates = None
108
-
109
-
@@ -1,61 +0,0 @@
1
- # type: ignore
2
- # ruff: noqa
3
- # flake8: noqa
4
- # @omlish-generated
5
- # Generated from Json.g4 by ANTLR 4.13.2
6
- from ....text.antlr._runtime._all import *
7
- if "." in __name__:
8
- from .JsonParser import JsonParser
9
- else:
10
- from JsonParser import JsonParser
11
-
12
- # This class defines a complete listener for a parse tree produced by JsonParser.
13
- class JsonListener(ParseTreeListener):
14
-
15
- # Enter a parse tree produced by JsonParser#json.
16
- def enterJson(self, ctx:JsonParser.JsonContext):
17
- pass
18
-
19
- # Exit a parse tree produced by JsonParser#json.
20
- def exitJson(self, ctx:JsonParser.JsonContext):
21
- pass
22
-
23
-
24
- # Enter a parse tree produced by JsonParser#obj.
25
- def enterObj(self, ctx:JsonParser.ObjContext):
26
- pass
27
-
28
- # Exit a parse tree produced by JsonParser#obj.
29
- def exitObj(self, ctx:JsonParser.ObjContext):
30
- pass
31
-
32
-
33
- # Enter a parse tree produced by JsonParser#pair.
34
- def enterPair(self, ctx:JsonParser.PairContext):
35
- pass
36
-
37
- # Exit a parse tree produced by JsonParser#pair.
38
- def exitPair(self, ctx:JsonParser.PairContext):
39
- pass
40
-
41
-
42
- # Enter a parse tree produced by JsonParser#arr.
43
- def enterArr(self, ctx:JsonParser.ArrContext):
44
- pass
45
-
46
- # Exit a parse tree produced by JsonParser#arr.
47
- def exitArr(self, ctx:JsonParser.ArrContext):
48
- pass
49
-
50
-
51
- # Enter a parse tree produced by JsonParser#value.
52
- def enterValue(self, ctx:JsonParser.ValueContext):
53
- pass
54
-
55
- # Exit a parse tree produced by JsonParser#value.
56
- def exitValue(self, ctx:JsonParser.ValueContext):
57
- pass
58
-
59
-
60
-
61
- del JsonParser
@@ -1,457 +0,0 @@
1
- # type: ignore
2
- # ruff: noqa
3
- # flake8: noqa
4
- # @omlish-generated
5
- # Generated from Json.g4 by ANTLR 4.13.2
6
- # encoding: utf-8
7
- from ....text.antlr._runtime._all import *
8
- from io import StringIO
9
- import sys
10
- if sys.version_info[1] > 5:
11
- from typing import TextIO
12
- else:
13
- from typing.io import TextIO
14
-
15
- def serializedATN():
16
- return [
17
- 4,1,12,57,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,1,0,1,0,1,0,1,
18
- 1,1,1,1,1,1,1,5,1,18,8,1,10,1,12,1,21,9,1,1,1,1,1,1,1,1,1,3,1,27,
19
- 8,1,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,5,3,37,8,3,10,3,12,3,40,9,3,
20
- 1,3,1,3,1,3,1,3,3,3,46,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,55,8,
21
- 4,1,4,0,0,5,0,2,4,6,8,0,0,61,0,10,1,0,0,0,2,26,1,0,0,0,4,28,1,0,
22
- 0,0,6,45,1,0,0,0,8,54,1,0,0,0,10,11,3,8,4,0,11,12,5,0,0,1,12,1,1,
23
- 0,0,0,13,14,5,1,0,0,14,19,3,4,2,0,15,16,5,2,0,0,16,18,3,4,2,0,17,
24
- 15,1,0,0,0,18,21,1,0,0,0,19,17,1,0,0,0,19,20,1,0,0,0,20,22,1,0,0,
25
- 0,21,19,1,0,0,0,22,23,5,3,0,0,23,27,1,0,0,0,24,25,5,1,0,0,25,27,
26
- 5,3,0,0,26,13,1,0,0,0,26,24,1,0,0,0,27,3,1,0,0,0,28,29,5,10,0,0,
27
- 29,30,5,4,0,0,30,31,3,8,4,0,31,5,1,0,0,0,32,33,5,5,0,0,33,38,3,8,
28
- 4,0,34,35,5,2,0,0,35,37,3,8,4,0,36,34,1,0,0,0,37,40,1,0,0,0,38,36,
29
- 1,0,0,0,38,39,1,0,0,0,39,41,1,0,0,0,40,38,1,0,0,0,41,42,5,6,0,0,
30
- 42,46,1,0,0,0,43,44,5,5,0,0,44,46,5,6,0,0,45,32,1,0,0,0,45,43,1,
31
- 0,0,0,46,7,1,0,0,0,47,55,5,10,0,0,48,55,5,11,0,0,49,55,3,2,1,0,50,
32
- 55,3,6,3,0,51,55,5,7,0,0,52,55,5,8,0,0,53,55,5,9,0,0,54,47,1,0,0,
33
- 0,54,48,1,0,0,0,54,49,1,0,0,0,54,50,1,0,0,0,54,51,1,0,0,0,54,52,
34
- 1,0,0,0,54,53,1,0,0,0,55,9,1,0,0,0,5,19,26,38,45,54
35
- ]
36
-
37
- class JsonParser ( Parser ):
38
-
39
- grammarFileName = "Json.g4"
40
-
41
- atn = ATNDeserializer().deserialize(serializedATN())
42
-
43
- decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
44
-
45
- sharedContextCache = PredictionContextCache()
46
-
47
- literalNames = [ "<INVALID>", "'{'", "','", "'}'", "':'", "'['", "']'",
48
- "'true'", "'false'", "'null'" ]
49
-
50
- symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
51
- "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
52
- "<INVALID>", "<INVALID>", "STRING", "NUMBER", "WS" ]
53
-
54
- RULE_json = 0
55
- RULE_obj = 1
56
- RULE_pair = 2
57
- RULE_arr = 3
58
- RULE_value = 4
59
-
60
- ruleNames = [ "json", "obj", "pair", "arr", "value" ]
61
-
62
- EOF = Token.EOF
63
- T__0=1
64
- T__1=2
65
- T__2=3
66
- T__3=4
67
- T__4=5
68
- T__5=6
69
- T__6=7
70
- T__7=8
71
- T__8=9
72
- STRING=10
73
- NUMBER=11
74
- WS=12
75
-
76
- def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
77
- super().__init__(input, output)
78
- self.checkVersion("4.13.2")
79
- self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
80
- self._predicates = None
81
-
82
-
83
-
84
-
85
- class JsonContext(ParserRuleContext):
86
- __slots__ = 'parser'
87
-
88
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
89
- super().__init__(parent, invokingState)
90
- self.parser = parser
91
-
92
- def value(self):
93
- return self.getTypedRuleContext(JsonParser.ValueContext,0)
94
-
95
-
96
- def EOF(self):
97
- return self.getToken(JsonParser.EOF, 0)
98
-
99
- def getRuleIndex(self):
100
- return JsonParser.RULE_json
101
-
102
- def enterRule(self, listener:ParseTreeListener):
103
- if hasattr( listener, "enterJson" ):
104
- listener.enterJson(self)
105
-
106
- def exitRule(self, listener:ParseTreeListener):
107
- if hasattr( listener, "exitJson" ):
108
- listener.exitJson(self)
109
-
110
- def accept(self, visitor:ParseTreeVisitor):
111
- if hasattr( visitor, "visitJson" ):
112
- return visitor.visitJson(self)
113
- else:
114
- return visitor.visitChildren(self)
115
-
116
-
117
-
118
-
119
- def json(self):
120
-
121
- localctx = JsonParser.JsonContext(self, self._ctx, self.state)
122
- self.enterRule(localctx, 0, self.RULE_json)
123
- try:
124
- self.enterOuterAlt(localctx, 1)
125
- self.state = 10
126
- self.value()
127
- self.state = 11
128
- self.match(JsonParser.EOF)
129
- except RecognitionException as re:
130
- localctx.exception = re
131
- self._errHandler.reportError(self, re)
132
- self._errHandler.recover(self, re)
133
- finally:
134
- self.exitRule()
135
- return localctx
136
-
137
-
138
- class ObjContext(ParserRuleContext):
139
- __slots__ = 'parser'
140
-
141
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
142
- super().__init__(parent, invokingState)
143
- self.parser = parser
144
-
145
- def pair(self, i:int=None):
146
- if i is None:
147
- return self.getTypedRuleContexts(JsonParser.PairContext)
148
- else:
149
- return self.getTypedRuleContext(JsonParser.PairContext,i)
150
-
151
-
152
- def getRuleIndex(self):
153
- return JsonParser.RULE_obj
154
-
155
- def enterRule(self, listener:ParseTreeListener):
156
- if hasattr( listener, "enterObj" ):
157
- listener.enterObj(self)
158
-
159
- def exitRule(self, listener:ParseTreeListener):
160
- if hasattr( listener, "exitObj" ):
161
- listener.exitObj(self)
162
-
163
- def accept(self, visitor:ParseTreeVisitor):
164
- if hasattr( visitor, "visitObj" ):
165
- return visitor.visitObj(self)
166
- else:
167
- return visitor.visitChildren(self)
168
-
169
-
170
-
171
-
172
- def obj(self):
173
-
174
- localctx = JsonParser.ObjContext(self, self._ctx, self.state)
175
- self.enterRule(localctx, 2, self.RULE_obj)
176
- self._la = 0 # Token type
177
- try:
178
- self.state = 26
179
- self._errHandler.sync(self)
180
- la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
181
- if la_ == 1:
182
- self.enterOuterAlt(localctx, 1)
183
- self.state = 13
184
- self.match(JsonParser.T__0)
185
- self.state = 14
186
- self.pair()
187
- self.state = 19
188
- self._errHandler.sync(self)
189
- _la = self._input.LA(1)
190
- while _la==2:
191
- self.state = 15
192
- self.match(JsonParser.T__1)
193
- self.state = 16
194
- self.pair()
195
- self.state = 21
196
- self._errHandler.sync(self)
197
- _la = self._input.LA(1)
198
-
199
- self.state = 22
200
- self.match(JsonParser.T__2)
201
- pass
202
-
203
- elif la_ == 2:
204
- self.enterOuterAlt(localctx, 2)
205
- self.state = 24
206
- self.match(JsonParser.T__0)
207
- self.state = 25
208
- self.match(JsonParser.T__2)
209
- pass
210
-
211
-
212
- except RecognitionException as re:
213
- localctx.exception = re
214
- self._errHandler.reportError(self, re)
215
- self._errHandler.recover(self, re)
216
- finally:
217
- self.exitRule()
218
- return localctx
219
-
220
-
221
- class PairContext(ParserRuleContext):
222
- __slots__ = 'parser'
223
-
224
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
225
- super().__init__(parent, invokingState)
226
- self.parser = parser
227
-
228
- def STRING(self):
229
- return self.getToken(JsonParser.STRING, 0)
230
-
231
- def value(self):
232
- return self.getTypedRuleContext(JsonParser.ValueContext,0)
233
-
234
-
235
- def getRuleIndex(self):
236
- return JsonParser.RULE_pair
237
-
238
- def enterRule(self, listener:ParseTreeListener):
239
- if hasattr( listener, "enterPair" ):
240
- listener.enterPair(self)
241
-
242
- def exitRule(self, listener:ParseTreeListener):
243
- if hasattr( listener, "exitPair" ):
244
- listener.exitPair(self)
245
-
246
- def accept(self, visitor:ParseTreeVisitor):
247
- if hasattr( visitor, "visitPair" ):
248
- return visitor.visitPair(self)
249
- else:
250
- return visitor.visitChildren(self)
251
-
252
-
253
-
254
-
255
- def pair(self):
256
-
257
- localctx = JsonParser.PairContext(self, self._ctx, self.state)
258
- self.enterRule(localctx, 4, self.RULE_pair)
259
- try:
260
- self.enterOuterAlt(localctx, 1)
261
- self.state = 28
262
- self.match(JsonParser.STRING)
263
- self.state = 29
264
- self.match(JsonParser.T__3)
265
- self.state = 30
266
- self.value()
267
- except RecognitionException as re:
268
- localctx.exception = re
269
- self._errHandler.reportError(self, re)
270
- self._errHandler.recover(self, re)
271
- finally:
272
- self.exitRule()
273
- return localctx
274
-
275
-
276
- class ArrContext(ParserRuleContext):
277
- __slots__ = 'parser'
278
-
279
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
280
- super().__init__(parent, invokingState)
281
- self.parser = parser
282
-
283
- def value(self, i:int=None):
284
- if i is None:
285
- return self.getTypedRuleContexts(JsonParser.ValueContext)
286
- else:
287
- return self.getTypedRuleContext(JsonParser.ValueContext,i)
288
-
289
-
290
- def getRuleIndex(self):
291
- return JsonParser.RULE_arr
292
-
293
- def enterRule(self, listener:ParseTreeListener):
294
- if hasattr( listener, "enterArr" ):
295
- listener.enterArr(self)
296
-
297
- def exitRule(self, listener:ParseTreeListener):
298
- if hasattr( listener, "exitArr" ):
299
- listener.exitArr(self)
300
-
301
- def accept(self, visitor:ParseTreeVisitor):
302
- if hasattr( visitor, "visitArr" ):
303
- return visitor.visitArr(self)
304
- else:
305
- return visitor.visitChildren(self)
306
-
307
-
308
-
309
-
310
- def arr(self):
311
-
312
- localctx = JsonParser.ArrContext(self, self._ctx, self.state)
313
- self.enterRule(localctx, 6, self.RULE_arr)
314
- self._la = 0 # Token type
315
- try:
316
- self.state = 45
317
- self._errHandler.sync(self)
318
- la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
319
- if la_ == 1:
320
- self.enterOuterAlt(localctx, 1)
321
- self.state = 32
322
- self.match(JsonParser.T__4)
323
- self.state = 33
324
- self.value()
325
- self.state = 38
326
- self._errHandler.sync(self)
327
- _la = self._input.LA(1)
328
- while _la==2:
329
- self.state = 34
330
- self.match(JsonParser.T__1)
331
- self.state = 35
332
- self.value()
333
- self.state = 40
334
- self._errHandler.sync(self)
335
- _la = self._input.LA(1)
336
-
337
- self.state = 41
338
- self.match(JsonParser.T__5)
339
- pass
340
-
341
- elif la_ == 2:
342
- self.enterOuterAlt(localctx, 2)
343
- self.state = 43
344
- self.match(JsonParser.T__4)
345
- self.state = 44
346
- self.match(JsonParser.T__5)
347
- pass
348
-
349
-
350
- except RecognitionException as re:
351
- localctx.exception = re
352
- self._errHandler.reportError(self, re)
353
- self._errHandler.recover(self, re)
354
- finally:
355
- self.exitRule()
356
- return localctx
357
-
358
-
359
- class ValueContext(ParserRuleContext):
360
- __slots__ = 'parser'
361
-
362
- def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
363
- super().__init__(parent, invokingState)
364
- self.parser = parser
365
-
366
- def STRING(self):
367
- return self.getToken(JsonParser.STRING, 0)
368
-
369
- def NUMBER(self):
370
- return self.getToken(JsonParser.NUMBER, 0)
371
-
372
- def obj(self):
373
- return self.getTypedRuleContext(JsonParser.ObjContext,0)
374
-
375
-
376
- def arr(self):
377
- return self.getTypedRuleContext(JsonParser.ArrContext,0)
378
-
379
-
380
- def getRuleIndex(self):
381
- return JsonParser.RULE_value
382
-
383
- def enterRule(self, listener:ParseTreeListener):
384
- if hasattr( listener, "enterValue" ):
385
- listener.enterValue(self)
386
-
387
- def exitRule(self, listener:ParseTreeListener):
388
- if hasattr( listener, "exitValue" ):
389
- listener.exitValue(self)
390
-
391
- def accept(self, visitor:ParseTreeVisitor):
392
- if hasattr( visitor, "visitValue" ):
393
- return visitor.visitValue(self)
394
- else:
395
- return visitor.visitChildren(self)
396
-
397
-
398
-
399
-
400
- def value(self):
401
-
402
- localctx = JsonParser.ValueContext(self, self._ctx, self.state)
403
- self.enterRule(localctx, 8, self.RULE_value)
404
- try:
405
- self.state = 54
406
- self._errHandler.sync(self)
407
- token = self._input.LA(1)
408
- if token in [10]:
409
- self.enterOuterAlt(localctx, 1)
410
- self.state = 47
411
- self.match(JsonParser.STRING)
412
- pass
413
- elif token in [11]:
414
- self.enterOuterAlt(localctx, 2)
415
- self.state = 48
416
- self.match(JsonParser.NUMBER)
417
- pass
418
- elif token in [1]:
419
- self.enterOuterAlt(localctx, 3)
420
- self.state = 49
421
- self.obj()
422
- pass
423
- elif token in [5]:
424
- self.enterOuterAlt(localctx, 4)
425
- self.state = 50
426
- self.arr()
427
- pass
428
- elif token in [7]:
429
- self.enterOuterAlt(localctx, 5)
430
- self.state = 51
431
- self.match(JsonParser.T__6)
432
- pass
433
- elif token in [8]:
434
- self.enterOuterAlt(localctx, 6)
435
- self.state = 52
436
- self.match(JsonParser.T__7)
437
- pass
438
- elif token in [9]:
439
- self.enterOuterAlt(localctx, 7)
440
- self.state = 53
441
- self.match(JsonParser.T__8)
442
- pass
443
- else:
444
- raise NoViableAltException(self)
445
-
446
- except RecognitionException as re:
447
- localctx.exception = re
448
- self._errHandler.reportError(self, re)
449
- self._errHandler.recover(self, re)
450
- finally:
451
- self.exitRule()
452
- return localctx
453
-
454
-
455
-
456
-
457
-
@@ -1,42 +0,0 @@
1
- # type: ignore
2
- # ruff: noqa
3
- # flake8: noqa
4
- # @omlish-generated
5
- # Generated from Json.g4 by ANTLR 4.13.2
6
- from ....text.antlr._runtime._all import *
7
- if "." in __name__:
8
- from .JsonParser import JsonParser
9
- else:
10
- from JsonParser import JsonParser
11
-
12
- # This class defines a complete generic visitor for a parse tree produced by JsonParser.
13
-
14
- class JsonVisitor(ParseTreeVisitor):
15
-
16
- # Visit a parse tree produced by JsonParser#json.
17
- def visitJson(self, ctx:JsonParser.JsonContext):
18
- return self.visitChildren(ctx)
19
-
20
-
21
- # Visit a parse tree produced by JsonParser#obj.
22
- def visitObj(self, ctx:JsonParser.ObjContext):
23
- return self.visitChildren(ctx)
24
-
25
-
26
- # Visit a parse tree produced by JsonParser#pair.
27
- def visitPair(self, ctx:JsonParser.PairContext):
28
- return self.visitChildren(ctx)
29
-
30
-
31
- # Visit a parse tree produced by JsonParser#arr.
32
- def visitArr(self, ctx:JsonParser.ArrContext):
33
- return self.visitChildren(ctx)
34
-
35
-
36
- # Visit a parse tree produced by JsonParser#value.
37
- def visitValue(self, ctx:JsonParser.ValueContext):
38
- return self.visitChildren(ctx)
39
-
40
-
41
-
42
- del JsonParser