llparse 0.1.0__tar.gz → 0.1.1__tar.gz
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.
- {llparse-0.1.0/llparse.egg-info → llparse-0.1.1}/PKG-INFO +5 -1
- llparse-0.1.0/PKG-INFO → llparse-0.1.1/README.md +4 -10
- {llparse-0.1.0 → llparse-0.1.1}/llparse/C_compiler.py +2 -2
- {llparse-0.1.0 → llparse-0.1.1}/llparse/compilator.py +5 -1
- {llparse-0.1.0 → llparse-0.1.1}/llparse/frontend.py +7 -7
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pybuilder/builder.py +1 -1
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pybuilder/main_code.py +2 -1
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/front.py +11 -4
- llparse-0.1.1/llparse/pyfront/namespace.py +3 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/nodes.py +11 -4
- llparse-0.1.0/README.md → llparse-0.1.1/llparse.egg-info/PKG-INFO +14 -0
- {llparse-0.1.0 → llparse-0.1.1}/pyproject.toml +1 -1
- llparse-0.1.0/llparse/pyfront/namespace.py +0 -1
- {llparse-0.1.0 → llparse-0.1.1}/LICENSE +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/__init__.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/constants.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/cython_builder.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/debug.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/dot.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/enumerator.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/header.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/llparse.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pybuilder/__init__.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pybuilder/loopchecker.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pybuilder/parsemap.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/containers.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/implementation.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/peephole.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/pyfront/transform.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/settings.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/spanalloc.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/test.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/tire.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse/trie.py +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse.egg-info/SOURCES.txt +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse.egg-info/dependency_links.txt +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/llparse.egg-info/top_level.txt +0 -0
- {llparse-0.1.0 → llparse-0.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llparse
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A Parody of llparse written for writing C Parsers with Python
|
|
5
5
|
Author-email: Vizonex <VizonexBusiness@gmail.com>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -9,6 +9,10 @@ License-File: LICENSE
|
|
|
9
9
|
Dynamic: license-file
|
|
10
10
|
|
|
11
11
|
# pyllparse
|
|
12
|
+
[](https://badge.fury.io/py/llparse)
|
|
13
|
+
[](https://badge.fury.io/py/llparse)
|
|
14
|
+
[](https://opensource.org/licenses/MIT)
|
|
15
|
+
|
|
12
16
|
A python parody of the typescript library llparse.
|
|
13
17
|
|
|
14
18
|
I take no credit for the orginal work done by indutny and I was originally very nervous about making
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: llparse
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: A Parody of llparse written for writing C Parsers with Python
|
|
5
|
-
Author-email: Vizonex <VizonexBusiness@gmail.com>
|
|
6
|
-
Requires-Python: >=3.9
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Dynamic: license-file
|
|
10
|
-
|
|
11
1
|
# pyllparse
|
|
2
|
+
[](https://badge.fury.io/py/llparse)
|
|
3
|
+
[](https://badge.fury.io/py/llparse)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
12
6
|
A python parody of the typescript library llparse.
|
|
13
7
|
|
|
14
8
|
I take no credit for the orginal work done by indutny and I was originally very nervous about making
|
|
@@ -182,9 +182,9 @@ class CCompiler:
|
|
|
182
182
|
else:
|
|
183
183
|
# TODO (Vizonex) Merge lines 139 & 140 together in a future update
|
|
184
184
|
callback = (
|
|
185
|
-
f"({info.prefix}__span_cb)"
|
|
185
|
+
f"(({info.prefix}__span_cb)"
|
|
186
186
|
+ ctx.spanCbField(span.index)
|
|
187
|
-
+ f"
|
|
187
|
+
+ f")"
|
|
188
188
|
)
|
|
189
189
|
|
|
190
190
|
args = [ctx.stateArg(), posField, f"(const char*) {ctx.endPosArg()}"]
|
|
@@ -105,6 +105,9 @@ class Code(Generic[T]):
|
|
|
105
105
|
def build(self, ctx: "Compilation", out: list[str]):
|
|
106
106
|
pass
|
|
107
107
|
|
|
108
|
+
def __hash__(self):
|
|
109
|
+
return hash(self.ref)
|
|
110
|
+
|
|
108
111
|
|
|
109
112
|
class External(Code[_frontend.code.External]):
|
|
110
113
|
def build(self, ctx: "Compilation", out: list[str]):
|
|
@@ -167,7 +170,7 @@ class Load(Field):
|
|
|
167
170
|
def doBuild(self, ctx: "Compilation", out: list[str]):
|
|
168
171
|
out.append(f"return {self.field(ctx)};")
|
|
169
172
|
|
|
170
|
-
|
|
173
|
+
|
|
171
174
|
# BIG ONE
|
|
172
175
|
|
|
173
176
|
|
|
@@ -409,6 +412,7 @@ class Empty(Node):
|
|
|
409
412
|
def __init__(self, ref: _frontend.node.Empty) -> None:
|
|
410
413
|
self.ref = ref
|
|
411
414
|
super().__init__(ref)
|
|
415
|
+
|
|
412
416
|
|
|
413
417
|
def doBuild(self, out: list[str]):
|
|
414
418
|
assert self.ref.otherwise
|
|
@@ -309,18 +309,18 @@ class Frontend:
|
|
|
309
309
|
bailout = False
|
|
310
310
|
for child in trie.children:
|
|
311
311
|
if isinstance(child.node, TrieEmpty):
|
|
312
|
-
print(
|
|
313
|
-
|
|
314
|
-
)
|
|
312
|
+
# print(
|
|
313
|
+
# 'non-leaf trie child of "%s" prevents table allocation' % node.name
|
|
314
|
+
# )
|
|
315
315
|
bailout = False
|
|
316
316
|
continue
|
|
317
317
|
|
|
318
318
|
empty: TrieEmpty = child.node
|
|
319
319
|
if getattr(empty, "value", None) is None:
|
|
320
|
-
print(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
)
|
|
320
|
+
# print(
|
|
321
|
+
# 'value passing trie leaf of "%s" prevents table allocation'
|
|
322
|
+
# % node.name
|
|
323
|
+
# )
|
|
324
324
|
bailout = False
|
|
325
325
|
continue
|
|
326
326
|
|
|
@@ -10,12 +10,12 @@ T = TypeVar("T")
|
|
|
10
10
|
Signature = TypeVar("Signature", bytes, str)
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@dataclass
|
|
13
|
+
@dataclass(unsafe_hash=True)
|
|
14
14
|
class IWrap(Generic[T]):
|
|
15
15
|
ref: T
|
|
16
16
|
|
|
17
|
-
def __hash__(self) -> int:
|
|
18
|
-
|
|
17
|
+
# def __hash__(self) -> int:
|
|
18
|
+
# return hash(self.ref)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def toCacheKey(value: Union[int, bool]) -> str:
|
|
@@ -33,6 +33,8 @@ class Code:
|
|
|
33
33
|
cacheKey: str
|
|
34
34
|
name: str
|
|
35
35
|
|
|
36
|
+
def __hash__(self):
|
|
37
|
+
return hash(self.cacheKey)
|
|
36
38
|
|
|
37
39
|
class External(Code):
|
|
38
40
|
"""Inherits from the `Code` class as a subclass of `Code`"""
|
|
@@ -44,8 +46,10 @@ class External(Code):
|
|
|
44
46
|
@dataclass
|
|
45
47
|
class Field(Code):
|
|
46
48
|
"""Inherits from `Code`"""
|
|
47
|
-
|
|
48
49
|
field: str
|
|
50
|
+
|
|
51
|
+
def __hash__(self):
|
|
52
|
+
return hash(self.cacheKey)
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
class FieldValueError(Exception):
|
|
@@ -167,6 +171,9 @@ class IUniqueName:
|
|
|
167
171
|
name: str
|
|
168
172
|
originalName: str
|
|
169
173
|
|
|
174
|
+
def __hash__(self):
|
|
175
|
+
return hash(self.originalName)
|
|
176
|
+
|
|
170
177
|
|
|
171
178
|
@dataclass
|
|
172
179
|
class Identifier:
|
|
@@ -26,11 +26,13 @@ class Slot:
|
|
|
26
26
|
return self.privNode
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
@dataclass
|
|
29
|
+
@dataclass(unsafe_hash=True)
|
|
30
30
|
class IUniqueName:
|
|
31
31
|
name: str
|
|
32
32
|
originalName: str
|
|
33
33
|
|
|
34
|
+
# def __hash__(self):
|
|
35
|
+
# return hash(self.name)
|
|
34
36
|
|
|
35
37
|
@dataclass
|
|
36
38
|
class IOtherwiseEdge:
|
|
@@ -81,6 +83,8 @@ class Node:
|
|
|
81
83
|
if otherwise:
|
|
82
84
|
yield Slot(otherwise.node, otherwise.node)
|
|
83
85
|
|
|
86
|
+
def __hash__(self):
|
|
87
|
+
return hash(self.id)
|
|
84
88
|
|
|
85
89
|
class Consume(Node):
|
|
86
90
|
def __init__(self, id: IUniqueName, field: str) -> None:
|
|
@@ -115,8 +119,11 @@ class Invoke(Node):
|
|
|
115
119
|
|
|
116
120
|
|
|
117
121
|
class Empty(Node):
|
|
118
|
-
def __init__(self, id: IUniqueName) -> None:
|
|
119
|
-
|
|
122
|
+
# def __init__(self, id: IUniqueName) -> None:
|
|
123
|
+
# super().__init__(id)
|
|
124
|
+
|
|
125
|
+
def __hash__(self):
|
|
126
|
+
return hash(self.id)
|
|
120
127
|
|
|
121
128
|
|
|
122
129
|
class Error(Node):
|
|
@@ -172,7 +179,7 @@ class SpanStart(Node):
|
|
|
172
179
|
self.field = field
|
|
173
180
|
self.callback = callback
|
|
174
181
|
super().__init__(id)
|
|
175
|
-
|
|
182
|
+
|
|
176
183
|
|
|
177
184
|
class SpanEnd(Node):
|
|
178
185
|
def __init__(
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llparse
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A Parody of llparse written for writing C Parsers with Python
|
|
5
|
+
Author-email: Vizonex <VizonexBusiness@gmail.com>
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
1
11
|
# pyllparse
|
|
12
|
+
[](https://badge.fury.io/py/llparse)
|
|
13
|
+
[](https://badge.fury.io/py/llparse)
|
|
14
|
+
[](https://opensource.org/licenses/MIT)
|
|
15
|
+
|
|
2
16
|
A python parody of the typescript library llparse.
|
|
3
17
|
|
|
4
18
|
I take no credit for the orginal work done by indutny and I was originally very nervous about making
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from ..pyfront import transform as transform
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|