syncraft 0.1.37__tar.gz → 0.1.38__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.

Potentially problematic release.


This version of syncraft might be problematic. Click here for more details.

Files changed (27) hide show
  1. {syncraft-0.1.37 → syncraft-0.1.38}/PKG-INFO +1 -1
  2. {syncraft-0.1.37 → syncraft-0.1.38}/pyproject.toml +1 -1
  3. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/syntax.py +13 -7
  4. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft.egg-info/PKG-INFO +1 -1
  5. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft.egg-info/SOURCES.txt +2 -1
  6. syncraft-0.1.38/tests/test_var.py +0 -0
  7. {syncraft-0.1.37 → syncraft-0.1.38}/LICENSE +0 -0
  8. {syncraft-0.1.37 → syncraft-0.1.38}/README.md +0 -0
  9. {syncraft-0.1.37 → syncraft-0.1.38}/setup.cfg +0 -0
  10. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/__init__.py +0 -0
  11. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/algebra.py +0 -0
  12. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/ast.py +0 -0
  13. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/constraint.py +0 -0
  14. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/diagnostic.py +0 -0
  15. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/finder.py +0 -0
  16. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/generator.py +0 -0
  17. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/parser.py +0 -0
  18. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/py.typed +0 -0
  19. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft/sqlite3.py +0 -0
  20. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft.egg-info/dependency_links.txt +0 -0
  21. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft.egg-info/requires.txt +0 -0
  22. {syncraft-0.1.37 → syncraft-0.1.38}/syncraft.egg-info/top_level.txt +0 -0
  23. {syncraft-0.1.37 → syncraft-0.1.38}/tests/test_bimap.py +0 -0
  24. {syncraft-0.1.37 → syncraft-0.1.38}/tests/test_find.py +0 -0
  25. {syncraft-0.1.37 → syncraft-0.1.38}/tests/test_parse.py +0 -0
  26. {syncraft-0.1.37 → syncraft-0.1.38}/tests/test_to.py +0 -0
  27. {syncraft-0.1.37 → syncraft-0.1.38}/tests/test_until.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.37
3
+ Version: 0.1.38
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.37"
3
+ version = "0.1.38"
4
4
  description = "Parser combinator library"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import (
4
4
  Optional, Any, TypeVar, Generic, Callable, Tuple, cast,
5
- Type, Literal, List
5
+ Type, Literal, List, overload
6
6
  )
7
7
  from dataclasses import dataclass, field, replace
8
8
  from functools import reduce
@@ -250,14 +250,20 @@ class Syntax(Generic[A, S]):
250
250
 
251
251
 
252
252
  ######################################################################## data processing combinators #########################################################
253
+ @overload
254
+ def bind(self,
255
+ var: Variable,
256
+ collector: None = None)-> Syntax[A | Marked[A], S]: ...
257
+
258
+ @overload
259
+ def bind(self,
260
+ var: Variable,
261
+ collector: Type[E]) -> Syntax[Collect[A, E] | Marked[Collect[A, E]], S]: ...
262
+
253
263
  def bind(self,
254
264
  var: Variable,
255
- collector: Optional[Type[E]]=None) -> Syntax[A |
256
- Marked[A] |
257
- Marked[Collect[A, E]] |
258
- Collect[A, E], S]:
259
- def bind_v(v: A | Marked[A] | Marked[Collect[A, E]] | Collect[A, E],
260
- s: S)->Tuple[A | Marked[A] | Marked[Collect[A, E]] | Collect[A, E], S]:
265
+ collector: Optional[Type[E]]=None) -> Syntax[Any, S]:
266
+ def bind_v(v: Any, s: S)->Tuple[Any, S]:
261
267
  return v, s.bind(var, v)
262
268
  if callable(collector):
263
269
  ret = self.to(collector).mark(var.name).map_all(bind_v) if var.name else self.to(collector).map_all(bind_v)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.37
3
+ Version: 0.1.38
4
4
  Summary: Parser combinator library
5
5
  Author-email: Michael Afmokt <michael@esacca.com>
6
6
  License-Expression: MIT
@@ -21,4 +21,5 @@ tests/test_bimap.py
21
21
  tests/test_find.py
22
22
  tests/test_parse.py
23
23
  tests/test_to.py
24
- tests/test_until.py
24
+ tests/test_until.py
25
+ tests/test_var.py
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
File without changes
File without changes