syncraft 0.1.32__tar.gz → 0.1.34__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 (25) hide show
  1. {syncraft-0.1.32 → syncraft-0.1.34}/PKG-INFO +1 -1
  2. {syncraft-0.1.32 → syncraft-0.1.34}/pyproject.toml +1 -1
  3. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft.egg-info/PKG-INFO +1 -1
  4. {syncraft-0.1.32 → syncraft-0.1.34}/tests/test_to.py +12 -2
  5. {syncraft-0.1.32 → syncraft-0.1.34}/LICENSE +0 -0
  6. {syncraft-0.1.32 → syncraft-0.1.34}/README.md +0 -0
  7. {syncraft-0.1.32 → syncraft-0.1.34}/setup.cfg +0 -0
  8. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/__init__.py +0 -0
  9. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/algebra.py +0 -0
  10. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/ast.py +0 -0
  11. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/constraint.py +0 -0
  12. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/diagnostic.py +0 -0
  13. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/finder.py +0 -0
  14. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/generator.py +0 -0
  15. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/parser.py +0 -0
  16. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/py.typed +0 -0
  17. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/sqlite3.py +0 -0
  18. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft/syntax.py +0 -0
  19. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft.egg-info/SOURCES.txt +0 -0
  20. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft.egg-info/dependency_links.txt +0 -0
  21. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft.egg-info/requires.txt +0 -0
  22. {syncraft-0.1.32 → syncraft-0.1.34}/syncraft.egg-info/top_level.txt +0 -0
  23. {syncraft-0.1.32 → syncraft-0.1.34}/tests/test_bimap.py +0 -0
  24. {syncraft-0.1.32 → syncraft-0.1.34}/tests/test_parse.py +0 -0
  25. {syncraft-0.1.32 → syncraft-0.1.34}/tests/test_until.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.32
3
+ Version: 0.1.34
4
4
  Summary: Parser combinator library
5
5
  Author-email: Michael Afmokt <michael@esacca.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "syncraft"
3
- version = "0.1.32"
3
+ version = "0.1.34"
4
4
  description = "Parser combinator library"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.32
3
+ Version: 0.1.34
4
4
  Summary: Parser combinator library
5
5
  Author-email: Michael Afmokt <michael@esacca.com>
6
6
  License-Expression: MIT
@@ -42,10 +42,20 @@ def test_to() -> None:
42
42
  syntax = (WHILE >> condition
43
43
  + ifthenelse.mark('body')
44
44
  // ~END).to(While)
45
- sql = 'while b,c,c if a,b then c,d else a,d end if a,b then c,d else a,d end'
45
+ sql = 'while b if a,b then c,d else a,d end if a,b then c,d else a,d end'
46
46
  ast = parse(syntax, sql, dialect='sqlite')
47
+ print(ast)
47
48
  g = gen.generate(syntax, ast, restore_pruned=True)
48
49
  assert ast == g
49
50
  x, f = g.bimap()
50
- print(x)
51
+ print(1, x)
51
52
  assert gen.generate(syntax, f(x), restore_pruned=True) == ast
53
+ x.body.append(x.body[0])
54
+ print(2, x)
55
+ print(f(x))
56
+ ast2 = gen.generate(syntax, f(x), restore_pruned=True)
57
+ print(ast2)
58
+ y, fy = ast2.bimap()
59
+ print(3, y)
60
+ assert y == x
61
+ assert gen.generate(syntax, fy(y), restore_pruned=True) == ast2
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes