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.
Files changed (51) hide show
  1. {llparse-0.1.9 → llparse-0.3.0}/PKG-INFO +13 -5
  2. {llparse-0.1.9 → llparse-0.3.0}/README.md +10 -3
  3. {llparse-0.1.9 → llparse-0.3.0}/llparse/C_compiler.py +3 -7
  4. llparse-0.3.0/llparse/__init__.py +12 -0
  5. llparse-0.3.0/llparse/_tempita/__init__.py +1281 -0
  6. llparse-0.3.0/llparse/_tempita/__init__.pyi +147 -0
  7. llparse-0.3.0/llparse/_tempita/__main__.py +3 -0
  8. llparse-0.3.0/llparse/_tempita/_looper.py +169 -0
  9. llparse-0.3.0/llparse/_tempita/_looper.pyi +49 -0
  10. llparse-0.3.0/llparse/_tempita/compat3.py +46 -0
  11. llparse-0.3.0/llparse/capi_builder.py +529 -0
  12. {llparse-0.1.9 → llparse-0.3.0}/llparse/compilator.py +108 -75
  13. {llparse-0.1.9 → llparse-0.3.0}/llparse/dot.py +5 -6
  14. {llparse-0.1.9 → llparse-0.3.0}/llparse/frontend.py +22 -19
  15. {llparse-0.1.9 → llparse-0.3.0}/llparse/header.py +18 -27
  16. {llparse-0.1.9 → llparse-0.3.0}/llparse/llparse.py +29 -24
  17. {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/builder.py +4 -4
  18. {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/loopchecker.py +2 -2
  19. {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/main_code.py +33 -19
  20. {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/parsemap.py +20 -0
  21. llparse-0.3.0/llparse/pyfront/__init__.py +2 -0
  22. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/code.py +6 -6
  23. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/namespace.py +1 -5
  24. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/nodes.py +15 -18
  25. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/peephole.py +6 -5
  26. {llparse-0.1.9 → llparse-0.3.0}/llparse/spanalloc.py +6 -9
  27. {llparse-0.1.9 → llparse-0.3.0}/llparse/trie.py +2 -3
  28. {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/PKG-INFO +13 -5
  29. {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/SOURCES.txt +9 -2
  30. llparse-0.3.0/llparse.egg-info/requires.txt +3 -0
  31. llparse-0.3.0/pyproject.toml +21 -0
  32. llparse-0.3.0/tests/test_compilator.py +53 -0
  33. {llparse-0.1.9 → llparse-0.3.0}/tests/test_frontend.py +7 -4
  34. llparse-0.1.9/llparse/__init__.py +0 -4
  35. llparse-0.1.9/llparse/cython_builder.py +0 -312
  36. llparse-0.1.9/llparse/pyfront/__init__.py +0 -3
  37. llparse-0.1.9/llparse/settings.py +0 -284
  38. llparse-0.1.9/pyproject.toml +0 -11
  39. {llparse-0.1.9 → llparse-0.3.0}/LICENSE +0 -0
  40. {llparse-0.1.9 → llparse-0.3.0}/llparse/constants.py +0 -0
  41. {llparse-0.1.9 → llparse-0.3.0}/llparse/debug.py +0 -0
  42. {llparse-0.1.9 → llparse-0.3.0}/llparse/enumerator.py +0 -0
  43. {llparse-0.1.9 → llparse-0.3.0}/llparse/errors.py +0 -0
  44. {llparse-0.1.9 → llparse-0.3.0}/llparse/pybuilder/__init__.py +0 -0
  45. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/implementation.py +0 -0
  46. {llparse-0.1.9 → llparse-0.3.0}/llparse/pyfront/transform.py +0 -0
  47. {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/dependency_links.txt +0 -0
  48. {llparse-0.1.9 → llparse-0.3.0}/llparse.egg-info/top_level.txt +0 -0
  49. {llparse-0.1.9 → llparse-0.3.0}/setup.cfg +0 -0
  50. {llparse-0.1.9 → llparse-0.3.0}/tests/test_loop_checker.py +0 -0
  51. {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.1.9
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.9
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 I was originally very nervous about making
19
- this python library that I made public...
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 I was originally very nervous about making
9
- this python library that I made public...
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], True)
175
+ cb = ctx.unwrapCode(span.callbacks[0])
180
176
  callback = ctx.buildCode(cb)
181
177
 
182
178
  else:
@@ -0,0 +1,12 @@
1
+ """
2
+ LLParse
3
+ -------
4
+
5
+ A Pythonic version of the typescript llparse library.
6
+ """
7
+
8
+ from .dot import Dot
9
+ from .llparse import LLParse
10
+
11
+ __version__ = "0.3.0"
12
+ __all__ = ("Dot", "LLParse")