syncraft 0.2.6__tar.gz → 0.3.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.
- {syncraft-0.2.6/syncraft.egg-info → syncraft-0.3.1}/PKG-INFO +11 -7
- {syncraft-0.2.6 → syncraft-0.3.1}/README.md +9 -5
- {syncraft-0.2.6 → syncraft-0.3.1}/pyproject.toml +8 -2
- syncraft-0.3.1/syncraft/__init__.py +100 -0
- syncraft-0.3.1/syncraft/algebra.py +558 -0
- syncraft-0.3.1/syncraft/analysis.py +5 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft/ast.py +328 -153
- syncraft-0.3.1/syncraft/cache/0323a09e1e0c6b6e2e03927451b2c035d6eb181fa866a4b162101715ffcc9362.lex +0 -0
- syncraft-0.3.1/syncraft/cache/0ad89ff788cd0fc733b414415e4b1fd310460a9040541adc766062c7f861699e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/0ca268f038e813af17052b8ab051ae43e4057353caa1dea58effce47d33566d7.lex +0 -0
- syncraft-0.3.1/syncraft/cache/0ca4b3915f90a20b730dfbbf73862b99c1b62849412412128b3ef604a71f937e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/139d2e8ffdf6c96c8d5c3f9508e0d27899d06cd396add66d4909f18495e42a1d.lex +0 -0
- syncraft-0.3.1/syncraft/cache/25a112229cad318466527a053645784cfe36e9241eaeea856f4ce81adbfafc4c.lex +0 -0
- syncraft-0.3.1/syncraft/cache/2bb80cb55dbf5d9902d2d31dbaa8c71ba9490fb5a190ccfbb688683039083b49.lex +0 -0
- syncraft-0.3.1/syncraft/cache/2f47f5ba4a43cbc4db0afc870d719211a799f8fba03698984477484f7b6f965d.lex +0 -0
- syncraft-0.3.1/syncraft/cache/30677f1ce02f17dd4e0d97213897801b44a50ff658933fb9efbf52dbe6a2a11c.lex +0 -0
- syncraft-0.3.1/syncraft/cache/38266a113e15c92ecc48d4abf750a1a0b252070eb264ab71e1f19012d7528c7e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/390d35713387fe8508cf75bf55faf1b687b2bbaca5b72f36889a6768d0987f32.lex +0 -0
- syncraft-0.3.1/syncraft/cache/3b1b656d9c899f56a20e81793d1d87ba38458257d08bb37a504d0c5f1987a24e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/3c4016322323afa5cfdfc2479f51da05d03d024c76dfce12022da54cf2540f37.lex +0 -0
- syncraft-0.3.1/syncraft/cache/427810660487e85706307e9e5549fc85b4c23cda5a3406b6b0669ae54cbdae65.lex +0 -0
- syncraft-0.3.1/syncraft/cache/49b33ff6f555bd8e97483b6ff3266b07c525184fb8f69363aacf81cb56fbf74b.lex +0 -0
- syncraft-0.3.1/syncraft/cache/4e2c4a34b56daff8a0927135b5982478e357d507e0a332753da73693ac8799e5.lex +0 -0
- syncraft-0.3.1/syncraft/cache/50aa0399e3d1a158b4d80daef829d30e5272dc588bd0c32941390f06241240f4.lex +0 -0
- syncraft-0.3.1/syncraft/cache/5b8aff732507a9fb7a9dfc7a658b32fff905d523d2e1b6c575939f2c13184d02.lex +0 -0
- syncraft-0.3.1/syncraft/cache/5deb7c7d3a82a6a19f1491eb9f3eb66e5170fd55f1211efa9a6fc71b19e1e9e8.lex +0 -0
- syncraft-0.3.1/syncraft/cache/658a7759b09a31aa5cf9ea73b0b08fa93d9c63086aed241363fab1dcac431d6b.lex +0 -0
- syncraft-0.3.1/syncraft/cache/7dd0dc70ecac5c1e305d63ffb17963aef0dec25befe55c06c709b4c472d338b9.lex +0 -0
- syncraft-0.3.1/syncraft/cache/8200ce656582293a902e6c6522561b40254ef48dca9f6cff7625959967bf4dac.lex +0 -0
- syncraft-0.3.1/syncraft/cache/932c3fa1ccf18106e6e593066f193f0f55c11e8916d036b8b29082dab688525e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/9412f55cc12c5adf290442e7252b21b219d5bb6ff644cac5e01605024bee05d9.lex +0 -0
- syncraft-0.3.1/syncraft/cache/96c113822d4de9a6fa1af13a071e8fbf6bde5410197d3f1972eccff80255e872.lex +0 -0
- syncraft-0.3.1/syncraft/cache/9aa52a5105add13fae8cef61cc1f32348a6966ce0303b695e9374ecb99f4d7a5.lex +0 -0
- syncraft-0.3.1/syncraft/cache/aa2d31d33d5449e55fd72e2e2b967a1f09e8a344dbbc5812d0bcca2885759671.lex +0 -0
- syncraft-0.3.1/syncraft/cache/add85e75b03bca439e73a57e260f03a7ec645ae079175935f6cbb9d3e0c4e5b2.lex +0 -0
- syncraft-0.3.1/syncraft/cache/afa3bcb917c588b6ac2bff31db152cfef2c002b666af43c0b4f3965cba15efbd.lex +0 -0
- syncraft-0.3.1/syncraft/cache/b337e4788fbb64e2528956c3fd5c13f007d0e03ba46ae30f8b67a892ec7355b2.lex +0 -0
- syncraft-0.3.1/syncraft/cache/c388cddeefd427af667f710fa41f1dc82c82cc33483f656f6014d0b8b17d45fc.lex +0 -0
- syncraft-0.3.1/syncraft/cache/c729bdd63c706a261c6409428cff67bf2bd8877c406b06f0e6c4db0affc04a82.lex +0 -0
- syncraft-0.3.1/syncraft/cache/ca2387078d1f30a773f30e0976ba6048e7c8cbc19d7587ac6c7b3963a0700336.lex +0 -0
- syncraft-0.3.1/syncraft/cache/d040ccc8a7547e7ae0761d19dd4bb47c9ca30ea749ef35c8806a1fdf2ff27dc8.lex +0 -0
- syncraft-0.3.1/syncraft/cache/dc25580cc40a059965b15cbcdfae30dfe32b4384e01c34271a37689c8e262432.lex +0 -0
- syncraft-0.3.1/syncraft/cache/dc5c91b4d0af5853a38985de81bab92342d902f545b0cd8322311f6acafcea32.lex +0 -0
- syncraft-0.3.1/syncraft/cache/e690d7175e1b1edc2969a0d93b0b39dc5d65223f2f549c3ee32d7456b6cee5dd.lex +0 -0
- syncraft-0.3.1/syncraft/cache/e91f0273605bf92d257f0cb14f9abc5bc21aa0b5de623a708c6a528601cd3522.lex +0 -0
- syncraft-0.3.1/syncraft/cache/ed412eadc92dcaa8579e1d205b80af2379b99c6ff94b621abfa97ed60b7ac196.lex +0 -0
- syncraft-0.3.1/syncraft/cache/ef2ca0cbca40bc2a4d138b3d2a35d66aa75a32b060a036a247b677da1c7922cc.lex +0 -0
- syncraft-0.3.1/syncraft/cache/f11a85a630fdf609a9f42cb639c05c84031db5df2c2f4289ff7fa39e9d647d0e.lex +0 -0
- syncraft-0.3.1/syncraft/cache/f19b6594061a559db2a96ac2aef7339cc7512cf5818e21c779d7899d7123e603.lex +0 -0
- syncraft-0.3.1/syncraft/cache/f421f43b060044eecb933e3b927fdd3401f7f349218a51a191afbba66a3192ca.lex +0 -0
- syncraft-0.3.1/syncraft/cache/f75e69062f54f1191105309cee8dccfc54687d231cbb2a9fa43266b3f2be8a20.lex +0 -0
- syncraft-0.3.1/syncraft/cache/fd1704e80122886e699c32ff6018e129808af0ae956b844f334b826aeaa4d0ac.lex +0 -0
- syncraft-0.3.1/syncraft/cache/fecdcd73b4f8c0b5cd1c7db3eab2a0ba81059fce196c3ff878b722c801f51830.lex +0 -0
- syncraft-0.3.1/syncraft/cache.py +472 -0
- syncraft-0.3.1/syncraft/charset.py +510 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft/constraint.py +25 -50
- syncraft-0.3.1/syncraft/dev.py +335 -0
- syncraft-0.3.1/syncraft/fa.py +1460 -0
- syncraft-0.3.1/syncraft/finder.py +111 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft/generator.py +206 -210
- syncraft-0.3.1/syncraft/input.py +484 -0
- syncraft-0.3.1/syncraft/lexer.py +574 -0
- syncraft-0.3.1/syncraft/parser.py +505 -0
- syncraft-0.3.1/syncraft/path.py +20 -0
- syncraft-0.3.1/syncraft/regex.py +515 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft/sqlite3.py +194 -473
- syncraft-0.3.1/syncraft/syntax.py +1232 -0
- syncraft-0.3.1/syncraft/token.py +296 -0
- syncraft-0.3.1/syncraft/utils.py +450 -0
- {syncraft-0.2.6 → syncraft-0.3.1/syncraft.egg-info}/PKG-INFO +11 -7
- syncraft-0.3.1/syncraft.egg-info/SOURCES.txt +102 -0
- syncraft-0.3.1/syncraft.egg-info/requires.txt +2 -0
- syncraft-0.3.1/tests/test_anchors.py +65 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/tests/test_bimap.py +101 -67
- syncraft-0.3.1/tests/test_charset.py +248 -0
- syncraft-0.3.1/tests/test_choice_kind_none.py +79 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/tests/test_constraint.py +13 -11
- syncraft-0.3.1/tests/test_dev_syntax2svg.py +39 -0
- syncraft-0.3.1/tests/test_dfa_minimize_issue.py +133 -0
- syncraft-0.3.1/tests/test_fabuilder.py +63 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/tests/test_find.py +21 -12
- syncraft-0.3.1/tests/test_generator_lr.py +101 -0
- syncraft-0.3.1/tests/test_graph.py +196 -0
- syncraft-0.3.1/tests/test_input.py +177 -0
- syncraft-0.3.1/tests/test_lazy.py +840 -0
- syncraft-0.3.1/tests/test_lazy_state_consistency.py +201 -0
- syncraft-0.3.1/tests/test_left_recursion_additional.py +109 -0
- syncraft-0.3.1/tests/test_lexer.py +152 -0
- syncraft-0.3.1/tests/test_nfa_dfa.py +390 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/tests/test_parse.py +30 -9
- syncraft-0.3.1/tests/test_parser_input.py +114 -0
- syncraft-0.3.1/tests/test_regex.py +268 -0
- syncraft-0.3.1/tests/test_regex_parser.py +566 -0
- syncraft-0.3.1/tests/test_reverse_dfa.py +40 -0
- syncraft-0.3.1/tests/test_syntax_run.py +16 -0
- syncraft-0.3.1/tests/test_syntax_spec.py +136 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/tests/test_to.py +17 -15
- syncraft-0.3.1/tests/test_token_spec.py +140 -0
- syncraft-0.3.1/tests/test_utils.py +41 -0
- syncraft-0.2.6/syncraft/__init__.py +0 -80
- syncraft-0.2.6/syncraft/algebra.py +0 -514
- syncraft-0.2.6/syncraft/cache.py +0 -113
- syncraft-0.2.6/syncraft/dev.py +0 -9
- syncraft-0.2.6/syncraft/finder.py +0 -120
- syncraft-0.2.6/syncraft/lexer.py +0 -131
- syncraft-0.2.6/syncraft/parser.py +0 -272
- syncraft-0.2.6/syncraft/syntax.py +0 -654
- syncraft-0.2.6/syncraft/utils.py +0 -214
- syncraft-0.2.6/syncraft/walker.py +0 -147
- syncraft-0.2.6/syncraft.egg-info/SOURCES.txt +0 -30
- syncraft-0.2.6/syncraft.egg-info/requires.txt +0 -2
- syncraft-0.2.6/tests/test_lazy.py +0 -50
- syncraft-0.2.6/tests/test_walk.py +0 -24
- {syncraft-0.2.6 → syncraft-0.3.1}/LICENSE +0 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/setup.cfg +0 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft/py.typed +0 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft.egg-info/dependency_links.txt +0 -0
- {syncraft-0.2.6 → syncraft-0.3.1}/syncraft.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: syncraft
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Parser combinator library
|
|
5
5
|
Author-email: Michael Afmokt <michael@esacca.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -9,7 +9,7 @@ Requires-Python: >=3.10
|
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Requires-Dist: rstr>=3.2.2
|
|
12
|
-
Requires-Dist: sqlglot>=27.
|
|
12
|
+
Requires-Dist: sqlglot>=27.14.0
|
|
13
13
|
Dynamic: license-file
|
|
14
14
|
|
|
15
15
|
# Syncraft
|
|
@@ -49,8 +49,12 @@ uv sync --group dev
|
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
TODO
|
|
52
|
-
- [ ]
|
|
53
|
-
- [ ]
|
|
54
|
-
- [ ]
|
|
55
|
-
- [ ]
|
|
56
|
-
- [ ]
|
|
52
|
+
- [ ] Static analysis tool based on Syntax.graph
|
|
53
|
+
- [ ] Profile hook on Cache
|
|
54
|
+
- [ ] try_parse based on Syntax.parallel
|
|
55
|
+
- [ ] regex.py convert Regex to FABuilder
|
|
56
|
+
- [ ] Visualization (railroad diagrams + AST).
|
|
57
|
+
- [ ] Interactive dev (Jupyter).
|
|
58
|
+
- [ ] Semantic layer (datalog + unification).
|
|
59
|
+
|
|
60
|
+
|
|
@@ -35,8 +35,12 @@ uv sync --group dev
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
TODO
|
|
38
|
-
- [ ]
|
|
39
|
-
- [ ]
|
|
40
|
-
- [ ]
|
|
41
|
-
- [ ]
|
|
42
|
-
- [ ]
|
|
38
|
+
- [ ] Static analysis tool based on Syntax.graph
|
|
39
|
+
- [ ] Profile hook on Cache
|
|
40
|
+
- [ ] try_parse based on Syntax.parallel
|
|
41
|
+
- [ ] regex.py convert Regex to FABuilder
|
|
42
|
+
- [ ] Visualization (railroad diagrams + AST).
|
|
43
|
+
- [ ] Interactive dev (Jupyter).
|
|
44
|
+
- [ ] Semantic layer (datalog + unification).
|
|
45
|
+
|
|
46
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "syncraft"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
description = "Parser combinator library"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
license-files = ["LICENSE"]
|
|
@@ -10,7 +10,7 @@ keywords = ["parser", "combinator", "sql", "sqlite", "generator", 'printer']
|
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
dependencies = [
|
|
12
12
|
"rstr>=3.2.2",
|
|
13
|
-
"sqlglot>=27.
|
|
13
|
+
"sqlglot>=27.14.0",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
|
|
@@ -31,8 +31,14 @@ dev = [
|
|
|
31
31
|
"nbval>=0.10.0",
|
|
32
32
|
"pytest-profiling>=1.8.1",
|
|
33
33
|
"snakeviz>=2.2.2",
|
|
34
|
+
"mypy>=1.18.2",
|
|
35
|
+
"regex>=2025.11.3",
|
|
36
|
+
"types-regex>=2025.11.3.20251106",
|
|
34
37
|
]
|
|
35
38
|
|
|
36
39
|
|
|
37
40
|
[tool.setuptools]
|
|
38
41
|
packages = ["syncraft"]
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.package-data]
|
|
44
|
+
syncraft = ["cache/**/*"]
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from .syntax import (
|
|
2
|
+
Syntax,
|
|
3
|
+
SyntaxSpec,
|
|
4
|
+
Graph,
|
|
5
|
+
LazySpec,
|
|
6
|
+
ThenSpec,
|
|
7
|
+
ChoiceSpec,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from .algebra import (
|
|
11
|
+
Algebra,
|
|
12
|
+
Error,
|
|
13
|
+
Left,
|
|
14
|
+
Right,
|
|
15
|
+
Either,
|
|
16
|
+
)
|
|
17
|
+
from .parser import (
|
|
18
|
+
Parser,
|
|
19
|
+
parse,
|
|
20
|
+
ParserState,
|
|
21
|
+
parser,
|
|
22
|
+
parse_data,
|
|
23
|
+
parse_word,
|
|
24
|
+
)
|
|
25
|
+
from .generator import (
|
|
26
|
+
Generator,
|
|
27
|
+
generate,
|
|
28
|
+
generate_with,
|
|
29
|
+
validate,
|
|
30
|
+
)
|
|
31
|
+
from .finder import (
|
|
32
|
+
Finder,
|
|
33
|
+
find,
|
|
34
|
+
matches,
|
|
35
|
+
anything,
|
|
36
|
+
)
|
|
37
|
+
from .constraint import (
|
|
38
|
+
Constraint,
|
|
39
|
+
Quantifier,
|
|
40
|
+
forall,
|
|
41
|
+
exists,
|
|
42
|
+
)
|
|
43
|
+
from .ast import (
|
|
44
|
+
AST,
|
|
45
|
+
Bimap,
|
|
46
|
+
Biarrow,
|
|
47
|
+
Token,
|
|
48
|
+
Then,
|
|
49
|
+
ThenKind,
|
|
50
|
+
Choice,
|
|
51
|
+
ChoiceKind,
|
|
52
|
+
Many,
|
|
53
|
+
Marked,
|
|
54
|
+
Collect,
|
|
55
|
+
Nothing,
|
|
56
|
+
)
|
|
57
|
+
from .charset import CodeUniverse, CharSet
|
|
58
|
+
from .fa import FABuilder, DFA, NFA, DFARunner, NFARunner
|
|
59
|
+
from .lexer import ExtLexer, Lexer
|
|
60
|
+
from .utils import (
|
|
61
|
+
FrozenDict,
|
|
62
|
+
CallWith,
|
|
63
|
+
)
|
|
64
|
+
from .input import (
|
|
65
|
+
StreamCursor,
|
|
66
|
+
)
|
|
67
|
+
from .cache import Cache
|
|
68
|
+
|
|
69
|
+
# Export commonly used class methods for convenience
|
|
70
|
+
literal = Syntax.literal
|
|
71
|
+
choice = Syntax.choice
|
|
72
|
+
|
|
73
|
+
__all__ = [
|
|
74
|
+
# charset
|
|
75
|
+
"CodeUniverse", "CharSet",
|
|
76
|
+
# fa
|
|
77
|
+
"FABuilder", "DFA", "NFA", "DFARunner", "NFARunner",
|
|
78
|
+
# lexer
|
|
79
|
+
"ExtLexer", "Lexer",
|
|
80
|
+
# cache
|
|
81
|
+
"Cache",
|
|
82
|
+
# algebra
|
|
83
|
+
"Algebra", "Error", "Left", "Right", "Either",
|
|
84
|
+
# syntax & core
|
|
85
|
+
"Syntax", "SyntaxSpec", "Graph", "LazySpec", "ThenSpec", "ChoiceSpec",
|
|
86
|
+
# parsing/generation helpers
|
|
87
|
+
"parse", "parser", "parse_data", "parse_word", "ParserState",
|
|
88
|
+
"generate", "generate_with", "validate", "Parser", "Generator",
|
|
89
|
+
# finder
|
|
90
|
+
"find", "matches", "anything", "Finder",
|
|
91
|
+
# constraints
|
|
92
|
+
"Constraint", "Quantifier", "forall", "exists", "FrozenDict", "CallWith",
|
|
93
|
+
# ast
|
|
94
|
+
"AST", "Token", "Then", "ThenKind", "Choice", "ChoiceKind", "Many", "Marked", "Collect", "Bimap", "Biarrow", "Nothing",
|
|
95
|
+
# input
|
|
96
|
+
"StreamCursor",
|
|
97
|
+
# convenience exports
|
|
98
|
+
"literal",
|
|
99
|
+
"choice",
|
|
100
|
+
]
|