llparse 0.1.9__tar.gz → 0.3.0__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.9 → llparse-0.3.0}/PKG-INFO +13 -5
- {llparse-0.1.9 → llparse-0.3.0}/README.md +10 -3
- {llparse-0.1.9 → llparse-0.3.0}/llparse/C_compiler.py +3 -7
- llparse-0.3.0/llparse/__init__.py +12 -0
- llparse-0.3.0/llparse/_tempita/__init__.py +1281 -0
- llparse-0.3.0/llparse/_tempita/__init__.pyi +147 -0
- llparse-0.3.0/llparse/_tempita/__main__.py +3 -0
- llparse-0.3.0/llparse/_tempita/_looper.py +169 -0
- llparse-0.3.0/llparse/_tempita/_looper.pyi +49 -0
- llparse-0.3.0/llparse/_tempita/compat3.py +46 -0
- llparse-0.3.0/llparse/capi_builder.py +529 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/compilator.py +108 -75
- {llparse-0.1.9 → llparse-0.3.0}/llparse/dot.py +5 -6
- {llparse-0.1.9 → llparse-0.3.0}/llparse/frontend.py +22 -19
- {llparse-0.1.9 → llparse-0.3.0}/llparse/header.py +18 -27
- {llparse-0.1.9 → llparse-0.3.0}/llparse/llparse.py +29 -24
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/builder.py +4 -4
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/loopchecker.py +2 -2
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/main_code.py +33 -19
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/parsemap.py +20 -0
- llparse-0.3.0/llparse/pyfront/__init__.py +2 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/code.py +6 -6
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/namespace.py +1 -5
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/nodes.py +15 -18
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/peephole.py +6 -5
- {llparse-0.1.9 → llparse-0.3.0}/llparse/spanalloc.py +6 -9
- {llparse-0.1.9 → llparse-0.3.0}/llparse/trie.py +2 -3
- {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/PKG-INFO +13 -5
- {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/SOURCES.txt +9 -2
- llparse-0.3.0/llparse.egg-info/requires.txt +3 -0
- llparse-0.3.0/pyproject.toml +21 -0
- llparse-0.3.0/tests/test_compilator.py +53 -0
- {llparse-0.1.9 → llparse-0.3.0}/tests/test_frontend.py +7 -4
- llparse-0.1.9/llparse/__init__.py +0 -4
- llparse-0.1.9/llparse/cython_builder.py +0 -312
- llparse-0.1.9/llparse/pyfront/__init__.py +0 -3
- llparse-0.1.9/llparse/settings.py +0 -284
- llparse-0.1.9/pyproject.toml +0 -11
- {llparse-0.1.9 → llparse-0.3.0}/LICENSE +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/constants.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/debug.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/enumerator.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/errors.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/__init__.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/implementation.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/transform.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/dependency_links.txt +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/top_level.txt +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/setup.cfg +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/tests/test_loop_checker.py +0 -0
- {llparse-0.1.9 → llparse-0.3.0}/tests/test_span_allocator.py +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llparse
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A Parody of llparse written for writing C Parsers with Python
|
|
5
5
|
Author-email: Vizonex <VizonexBusiness@gmail.com>
|
|
6
|
-
Requires-Python: >=3.
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
+
Requires-Dist: typing_extensions; python_version < "3.13"
|
|
9
10
|
Dynamic: license-file
|
|
10
11
|
|
|
11
12
|
# pyllparse
|
|
@@ -15,15 +16,16 @@ Dynamic: license-file
|
|
|
15
16
|
|
|
16
17
|
A python parody of the typescript library llparse.
|
|
17
18
|
|
|
18
|
-
I take no credit for the orginal work done by indutny and the other node-js contributors involved and
|
|
19
|
-
|
|
19
|
+
I take no credit for the orginal work done by indutny and the other node-js contributors involved and my additional
|
|
20
|
+
features were meant to inspire activity with the original library again.
|
|
20
21
|
|
|
21
22
|
Links to the original library
|
|
22
23
|
- https://llparse.org
|
|
23
24
|
- https://github.com/nodejs/llparse
|
|
24
25
|
|
|
25
26
|
Unlike the typescript library all 3 of llparse's libraries were combined in this version of the code for the sake of portability...
|
|
26
|
-
I ended up mentioning how I did this a while back and I also had a concept for a C parser as well but I just didn't like it and I ended up using this instead but I also learned typescript as a bonus and It was alot of fun for me. I don't plan to make this into a real pypi library yet but I also didn't want to take away from the magic of the original source code that I borrowed from
|
|
27
|
+
I ended up mentioning how I did this a while back and I also had a concept for a C parser as well but I just didn't like it and I ended up using this instead but I also learned typescript as a bonus and It was alot of fun for me. I don't plan to make this into a real pypi library yet but I also didn't want to take away from the magic of the original source code that I borrowed from.
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
# Looking back on my dead work 2 years later
|
|
29
31
|
I had this idea lay somewhat dormant for 2 years and now seeing that I wanted to write a new socks5 server parser writing it in python
|
|
@@ -134,3 +136,9 @@ open("http_parser.h", "w").write(c.header)
|
|
|
134
136
|
|
|
135
137
|
## Video Showcasing this library
|
|
136
138
|
- https://youtu.be/YQOzJ2BghQw
|
|
139
|
+
|
|
140
|
+
## Examples of this library being in use
|
|
141
|
+
- [llh2](https://github.com/Vizonex/llh2) I would like to move to the typescript version once my ideas and
|
|
142
|
+
features I've added in get fully implemented but we shall wait and see...
|
|
143
|
+
|
|
144
|
+
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
A python parody of the typescript library llparse.
|
|
7
7
|
|
|
8
|
-
I take no credit for the orginal work done by indutny and the other node-js contributors involved and
|
|
9
|
-
|
|
8
|
+
I take no credit for the orginal work done by indutny and the other node-js contributors involved and my additional
|
|
9
|
+
features were meant to inspire activity with the original library again.
|
|
10
10
|
|
|
11
11
|
Links to the original library
|
|
12
12
|
- https://llparse.org
|
|
13
13
|
- https://github.com/nodejs/llparse
|
|
14
14
|
|
|
15
15
|
Unlike the typescript library all 3 of llparse's libraries were combined in this version of the code for the sake of portability...
|
|
16
|
-
I ended up mentioning how I did this a while back and I also had a concept for a C parser as well but I just didn't like it and I ended up using this instead but I also learned typescript as a bonus and It was alot of fun for me. I don't plan to make this into a real pypi library yet but I also didn't want to take away from the magic of the original source code that I borrowed from
|
|
16
|
+
I ended up mentioning how I did this a while back and I also had a concept for a C parser as well but I just didn't like it and I ended up using this instead but I also learned typescript as a bonus and It was alot of fun for me. I don't plan to make this into a real pypi library yet but I also didn't want to take away from the magic of the original source code that I borrowed from.
|
|
17
|
+
|
|
17
18
|
|
|
18
19
|
# Looking back on my dead work 2 years later
|
|
19
20
|
I had this idea lay somewhat dormant for 2 years and now seeing that I wanted to write a new socks5 server parser writing it in python
|
|
@@ -124,3 +125,9 @@ open("http_parser.h", "w").write(c.header)
|
|
|
124
125
|
|
|
125
126
|
## Video Showcasing this library
|
|
126
127
|
- https://youtu.be/YQOzJ2BghQw
|
|
128
|
+
|
|
129
|
+
## Examples of this library being in use
|
|
130
|
+
- [llh2](https://github.com/Vizonex/llh2) I would like to move to the typescript version once my ideas and
|
|
131
|
+
features I've added in get fully implemented but we shall wait and see...
|
|
132
|
+
|
|
133
|
+
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
from .compilator import Compilation, ICompilerOptions, Node
|
|
4
|
-
from .constants import
|
|
2
|
+
from .constants import ARG_STATE, ARG_POS, ARG_ENDPOS, VAR_MATCH, STATE_ERROR
|
|
5
3
|
from .frontend import IFrontendResult
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
class CCompiler:
|
|
9
7
|
"""The Final HeadPeice where the Main C-Code gets compiled to..."""
|
|
10
8
|
|
|
11
|
-
def __init__(
|
|
12
|
-
self, header: Optional[str] = None, debug: Optional[str] = None
|
|
13
|
-
) -> None:
|
|
9
|
+
def __init__(self, header: str | None = None, debug: str | None = None) -> None:
|
|
14
10
|
# NOTE Unlike in typescript llparse Containers are not Required since I'm using a different methoad to translate those parts...
|
|
15
11
|
self.options = ICompilerOptions(debug, header)
|
|
16
12
|
|
|
@@ -176,7 +172,7 @@ class CCompiler:
|
|
|
176
172
|
posField = ctx.spanPosField(span.index)
|
|
177
173
|
|
|
178
174
|
if len(span.callbacks) == 1:
|
|
179
|
-
cb = ctx.unwrapCode(span.callbacks[0]
|
|
175
|
+
cb = ctx.unwrapCode(span.callbacks[0])
|
|
180
176
|
callback = ctx.buildCode(cb)
|
|
181
177
|
|
|
182
178
|
else:
|