algex 1.1.2__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.
- algex-1.1.2/LICENSE +21 -0
- algex-1.1.2/PKG-INFO +49 -0
- algex-1.1.2/VERSION +1 -0
- algex-1.1.2/export/PYTHON/AlgexPython.cpp +708 -0
- algex-1.1.2/export/PYTHON/AlgexPython.stub-patterns +35 -0
- algex-1.1.2/export/PYTHON/AlgexPython.symbols +4 -0
- algex-1.1.2/export/PYTHON/CMakeLists.txt +34 -0
- algex-1.1.2/export/PYTHON/README.md +30 -0
- algex-1.1.2/export/PYTHON/algex/__init__.py +31 -0
- algex-1.1.2/export/PYTHON/algex/_errors.py +35 -0
- algex-1.1.2/export/PYTHON/algex/py.typed +0 -0
- algex-1.1.2/export/PYTHON/tests/test_algex.py +256 -0
- algex-1.1.2/export/PYTHON/tests/typing_assertions.py +41 -0
- algex-1.1.2/include/Algex/AffineForm.cpp +168 -0
- algex-1.1.2/include/Algex/AffineForm.hpp +50 -0
- algex-1.1.2/include/Algex/Algex.hpp +11 -0
- algex-1.1.2/include/Algex/Arithmetic.cpp +271 -0
- algex-1.1.2/include/Algex/Arithmetic.hpp +66 -0
- algex-1.1.2/include/Algex/BacktrackingMachine.cpp +1611 -0
- algex-1.1.2/include/Algex/BacktrackingMachine.hpp +278 -0
- algex-1.1.2/include/Algex/Base.hpp +56 -0
- algex-1.1.2/include/Algex/ByteSet.cpp +283 -0
- algex-1.1.2/include/Algex/ByteSet.hpp +54 -0
- algex-1.1.2/include/Algex/CompileError.cpp +49 -0
- algex-1.1.2/include/Algex/CompileError.hpp +32 -0
- algex-1.1.2/include/Algex/CompiledExpression.cpp +706 -0
- algex-1.1.2/include/Algex/CompiledExpression.hpp +117 -0
- algex-1.1.2/include/Algex/CompiledPattern.hpp +79 -0
- algex-1.1.2/include/Algex/ConstraintCatalog.cpp +73 -0
- algex-1.1.2/include/Algex/ConstraintCatalog.hpp +74 -0
- algex-1.1.2/include/Algex/ContextualMemo.cpp +78 -0
- algex-1.1.2/include/Algex/ContextualMemo.hpp +26 -0
- algex-1.1.2/include/Algex/ExampleGenerator.cpp +407 -0
- algex-1.1.2/include/Algex/ExampleGenerator.hpp +88 -0
- algex-1.1.2/include/Algex/Explanation.cpp +391 -0
- algex-1.1.2/include/Algex/Explanation.hpp +38 -0
- algex-1.1.2/include/Algex/ExpressionSyntax.cpp +548 -0
- algex-1.1.2/include/Algex/ExpressionSyntax.hpp +154 -0
- algex-1.1.2/include/Algex/ExpressionTypeChecker.cpp +275 -0
- algex-1.1.2/include/Algex/ExpressionTypeChecker.hpp +50 -0
- algex-1.1.2/include/Algex/LazyDfa.cpp +224 -0
- algex-1.1.2/include/Algex/LazyDfa.hpp +64 -0
- algex-1.1.2/include/Algex/LiteralScanner.cpp +139 -0
- algex-1.1.2/include/Algex/LiteralScanner.hpp +46 -0
- algex-1.1.2/include/Algex/Match.cpp +161 -0
- algex-1.1.2/include/Algex/Match.hpp +89 -0
- algex-1.1.2/include/Algex/Nfa.cpp +462 -0
- algex-1.1.2/include/Algex/Nfa.hpp +67 -0
- algex-1.1.2/include/Algex/Pattern.cpp +195 -0
- algex-1.1.2/include/Algex/Pattern.hpp +66 -0
- algex-1.1.2/include/Algex/PatternSyntax.cpp +1265 -0
- algex-1.1.2/include/Algex/PatternSyntax.hpp +216 -0
- algex-1.1.2/include/Algex/Program.cpp +270 -0
- algex-1.1.2/include/Algex/Program.hpp +152 -0
- algex-1.1.2/include/Algex/ProgramCompiler.cpp +1647 -0
- algex-1.1.2/include/Algex/ProgramCompiler.hpp +127 -0
- algex-1.1.2/include/Algex/StaticAnalysis.cpp +912 -0
- algex-1.1.2/include/Algex/StaticAnalysis.hpp +44 -0
- algex-1.1.2/include/Algex/TextOffsets.cpp +114 -0
- algex-1.1.2/include/Algex/TextOffsets.hpp +38 -0
- algex-1.1.2/include/Algex/Unicode.cpp +735 -0
- algex-1.1.2/include/Algex/Unicode.hpp +190 -0
- algex-1.1.2/include/Algex/UnicodeTables.cpp +519 -0
- algex-1.1.2/include/Algex/VariableBindings.cpp +242 -0
- algex-1.1.2/include/Algex/VariableBindings.hpp +95 -0
- algex-1.1.2/include/Algex/VariableTable.cpp +81 -0
- algex-1.1.2/include/Algex/VariableTable.hpp +61 -0
- algex-1.1.2/include/Algex/Version.cpp +14 -0
- algex-1.1.2/include/Algex/Version.hpp +9 -0
- algex-1.1.2/pyproject.toml +66 -0
algex-1.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ITGourmand
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
algex-1.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: algex
|
|
3
|
+
Version: 1.1.2
|
|
4
|
+
Summary: Regular expressions extended with algebraic variables, typed captures and conditions
|
|
5
|
+
Keywords: regex,regular-expression,parser,algebra
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Programming Language :: C++
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Topic :: Text Processing
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Project-URL: Homepage, https://github.com/ITGourmand/Algex
|
|
12
|
+
Project-URL: Documentation, https://itgourmand.github.io/Algex/docs/python.html
|
|
13
|
+
Project-URL: Playground, https://itgourmand.github.io/Algex/
|
|
14
|
+
Project-URL: Issues, https://github.com/ITGourmand/Algex/issues
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: pytest; extra == "test"
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Algex for Python
|
|
21
|
+
|
|
22
|
+
Regular expressions that can count, read numbers and check conditions: `a{n}b{n}c{n}`, a length followed by that many
|
|
23
|
+
bytes, `c == a + b` between captured numbers. A C++26 engine with the shape of `re`.
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
import algex
|
|
27
|
+
|
|
28
|
+
netstring = algex.compile(r"(?<n>\d+):(?<data>.{n}),")
|
|
29
|
+
match = netstring.search("xx 3:abc,5:hello,")
|
|
30
|
+
match.span(), match["data"], match.variables # (3, 9) 'abc' {'n': 3}
|
|
31
|
+
|
|
32
|
+
addition = algex.compile(r"(?<a>\d+)\+(?<b>\d+)=(?<c>\d+)", where="c == a + b")
|
|
33
|
+
addition.matches("12+30=42") # True
|
|
34
|
+
print(addition.explain("12+30=43")) # where and why it fails
|
|
35
|
+
addition.examples(5), addition.counter_examples(5)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- `fullmatch`, `search`, `finditer` (lazy), `matches`, `contains`, `explain`, `examples`, `counter_examples`;
|
|
39
|
+
variables come back typed (`int`, `str`, `list[int]`, `list[str]`).
|
|
40
|
+
- A `str` pattern reads characters, as `re` does: `.{3}` matches `"été"`, `\w+` takes `"déjà"`, `\p{Lu}` and `(?i)`
|
|
41
|
+
know every letter, `len(w)` counts characters. A `bytes` pattern reads bytes; `unicode=` chooses explicitly.
|
|
42
|
+
- `str` and `bytes`, thread-safe patterns (the GIL is released on long texts), typed like `re`: `Pattern[str]`,
|
|
43
|
+
`Match[bytes]`.
|
|
44
|
+
- Wheels for Linux (glibc and musl, x86-64 and ARM64), macOS and Windows; one stable-ABI wheel serves Python 3.12 and
|
|
45
|
+
later.
|
|
46
|
+
|
|
47
|
+
Documentation: <https://itgourmand.github.io/Algex/docs/python.html>; syntax: <https://itgourmand.github.io/Algex/docs/syntax.html>;
|
|
48
|
+
source and the C++, JavaScript and command-line versions: <https://github.com/ITGourmand/Algex>.
|
|
49
|
+
Try it in the browser: <https://itgourmand.github.io/Algex/>.
|
algex-1.1.2/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.1.2
|