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.
Files changed (70) hide show
  1. algex-1.1.2/LICENSE +21 -0
  2. algex-1.1.2/PKG-INFO +49 -0
  3. algex-1.1.2/VERSION +1 -0
  4. algex-1.1.2/export/PYTHON/AlgexPython.cpp +708 -0
  5. algex-1.1.2/export/PYTHON/AlgexPython.stub-patterns +35 -0
  6. algex-1.1.2/export/PYTHON/AlgexPython.symbols +4 -0
  7. algex-1.1.2/export/PYTHON/CMakeLists.txt +34 -0
  8. algex-1.1.2/export/PYTHON/README.md +30 -0
  9. algex-1.1.2/export/PYTHON/algex/__init__.py +31 -0
  10. algex-1.1.2/export/PYTHON/algex/_errors.py +35 -0
  11. algex-1.1.2/export/PYTHON/algex/py.typed +0 -0
  12. algex-1.1.2/export/PYTHON/tests/test_algex.py +256 -0
  13. algex-1.1.2/export/PYTHON/tests/typing_assertions.py +41 -0
  14. algex-1.1.2/include/Algex/AffineForm.cpp +168 -0
  15. algex-1.1.2/include/Algex/AffineForm.hpp +50 -0
  16. algex-1.1.2/include/Algex/Algex.hpp +11 -0
  17. algex-1.1.2/include/Algex/Arithmetic.cpp +271 -0
  18. algex-1.1.2/include/Algex/Arithmetic.hpp +66 -0
  19. algex-1.1.2/include/Algex/BacktrackingMachine.cpp +1611 -0
  20. algex-1.1.2/include/Algex/BacktrackingMachine.hpp +278 -0
  21. algex-1.1.2/include/Algex/Base.hpp +56 -0
  22. algex-1.1.2/include/Algex/ByteSet.cpp +283 -0
  23. algex-1.1.2/include/Algex/ByteSet.hpp +54 -0
  24. algex-1.1.2/include/Algex/CompileError.cpp +49 -0
  25. algex-1.1.2/include/Algex/CompileError.hpp +32 -0
  26. algex-1.1.2/include/Algex/CompiledExpression.cpp +706 -0
  27. algex-1.1.2/include/Algex/CompiledExpression.hpp +117 -0
  28. algex-1.1.2/include/Algex/CompiledPattern.hpp +79 -0
  29. algex-1.1.2/include/Algex/ConstraintCatalog.cpp +73 -0
  30. algex-1.1.2/include/Algex/ConstraintCatalog.hpp +74 -0
  31. algex-1.1.2/include/Algex/ContextualMemo.cpp +78 -0
  32. algex-1.1.2/include/Algex/ContextualMemo.hpp +26 -0
  33. algex-1.1.2/include/Algex/ExampleGenerator.cpp +407 -0
  34. algex-1.1.2/include/Algex/ExampleGenerator.hpp +88 -0
  35. algex-1.1.2/include/Algex/Explanation.cpp +391 -0
  36. algex-1.1.2/include/Algex/Explanation.hpp +38 -0
  37. algex-1.1.2/include/Algex/ExpressionSyntax.cpp +548 -0
  38. algex-1.1.2/include/Algex/ExpressionSyntax.hpp +154 -0
  39. algex-1.1.2/include/Algex/ExpressionTypeChecker.cpp +275 -0
  40. algex-1.1.2/include/Algex/ExpressionTypeChecker.hpp +50 -0
  41. algex-1.1.2/include/Algex/LazyDfa.cpp +224 -0
  42. algex-1.1.2/include/Algex/LazyDfa.hpp +64 -0
  43. algex-1.1.2/include/Algex/LiteralScanner.cpp +139 -0
  44. algex-1.1.2/include/Algex/LiteralScanner.hpp +46 -0
  45. algex-1.1.2/include/Algex/Match.cpp +161 -0
  46. algex-1.1.2/include/Algex/Match.hpp +89 -0
  47. algex-1.1.2/include/Algex/Nfa.cpp +462 -0
  48. algex-1.1.2/include/Algex/Nfa.hpp +67 -0
  49. algex-1.1.2/include/Algex/Pattern.cpp +195 -0
  50. algex-1.1.2/include/Algex/Pattern.hpp +66 -0
  51. algex-1.1.2/include/Algex/PatternSyntax.cpp +1265 -0
  52. algex-1.1.2/include/Algex/PatternSyntax.hpp +216 -0
  53. algex-1.1.2/include/Algex/Program.cpp +270 -0
  54. algex-1.1.2/include/Algex/Program.hpp +152 -0
  55. algex-1.1.2/include/Algex/ProgramCompiler.cpp +1647 -0
  56. algex-1.1.2/include/Algex/ProgramCompiler.hpp +127 -0
  57. algex-1.1.2/include/Algex/StaticAnalysis.cpp +912 -0
  58. algex-1.1.2/include/Algex/StaticAnalysis.hpp +44 -0
  59. algex-1.1.2/include/Algex/TextOffsets.cpp +114 -0
  60. algex-1.1.2/include/Algex/TextOffsets.hpp +38 -0
  61. algex-1.1.2/include/Algex/Unicode.cpp +735 -0
  62. algex-1.1.2/include/Algex/Unicode.hpp +190 -0
  63. algex-1.1.2/include/Algex/UnicodeTables.cpp +519 -0
  64. algex-1.1.2/include/Algex/VariableBindings.cpp +242 -0
  65. algex-1.1.2/include/Algex/VariableBindings.hpp +95 -0
  66. algex-1.1.2/include/Algex/VariableTable.cpp +81 -0
  67. algex-1.1.2/include/Algex/VariableTable.hpp +61 -0
  68. algex-1.1.2/include/Algex/Version.cpp +14 -0
  69. algex-1.1.2/include/Algex/Version.hpp +9 -0
  70. 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