syncraft 0.1.24__tar.gz → 0.1.25__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 (24) hide show
  1. {syncraft-0.1.24 → syncraft-0.1.25}/PKG-INFO +1 -1
  2. {syncraft-0.1.24 → syncraft-0.1.25}/pyproject.toml +1 -1
  3. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/ast.py +6 -3
  4. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft.egg-info/PKG-INFO +1 -1
  5. {syncraft-0.1.24 → syncraft-0.1.25}/LICENSE +0 -0
  6. {syncraft-0.1.24 → syncraft-0.1.25}/README.md +0 -0
  7. {syncraft-0.1.24 → syncraft-0.1.25}/setup.cfg +0 -0
  8. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/__init__.py +0 -0
  9. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/algebra.py +0 -0
  10. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/constraint.py +0 -0
  11. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/diagnostic.py +0 -0
  12. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/finder.py +0 -0
  13. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/generator.py +0 -0
  14. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/parser.py +0 -0
  15. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/py.typed +0 -0
  16. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/sqlite3.py +0 -0
  17. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft/syntax.py +0 -0
  18. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft.egg-info/SOURCES.txt +0 -0
  19. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft.egg-info/dependency_links.txt +0 -0
  20. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft.egg-info/requires.txt +0 -0
  21. {syncraft-0.1.24 → syncraft-0.1.25}/syncraft.egg-info/top_level.txt +0 -0
  22. {syncraft-0.1.24 → syncraft-0.1.25}/tests/test_bimap.py +0 -0
  23. {syncraft-0.1.24 → syncraft-0.1.25}/tests/test_parse.py +0 -0
  24. {syncraft-0.1.24 → syncraft-0.1.25}/tests/test_until.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.24
3
+ Version: 0.1.25
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.24"
3
+ version = "0.1.25"
4
4
  description = "Parser combinator library"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -182,7 +182,7 @@ class ThenResult(Generic[A, B], StructuralResult):
182
182
  return tuple(ret)
183
183
  return ret, invf
184
184
 
185
- def bimap(self, f: Bimap[Any, Any]=Bimap.identity()) -> Tuple[MarkedThen, Callable[[MarkedThen], ThenResult[A, B]]]:
185
+ def bimap(self, f: Bimap[Any, Any]=Bimap.identity()) -> Tuple[FlatThen, Callable[[FlatThen], ThenResult[A, B]]]:
186
186
  match self.kind:
187
187
  case ThenKind.LEFT:
188
188
  lb, linv = self.left.bimap(f) if isinstance(self.left, StructuralResult) else f(self.left)
@@ -206,8 +206,11 @@ class ThenResult(Generic[A, B], StructuralResult):
206
206
  ra = rinv(rraw)
207
207
  return replace(self, left=la, right=ra)
208
208
  return left_v + right_v, invf
209
- # data, func = ThenResult.collect_marked(left_v + right_v)
210
- # return data, lambda d: invf(func(d))
209
+
210
+ def bimap_collected(self, f: Bimap[Any, Any]=Bimap.identity()) -> Tuple[MarkedThen, Callable[[MarkedThen], ThenResult[A, B]]]:
211
+ data, invf = self.bimap(f)
212
+ data, func = ThenResult.collect_marked(data)
213
+ return data, lambda d: invf(func(d))
211
214
 
212
215
 
213
216
  def arity(self)->int:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.24
3
+ Version: 0.1.25
4
4
  Summary: Parser combinator library
5
5
  Author-email: Michael Afmokt <michael@esacca.com>
6
6
  License-Expression: MIT
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