syncraft 0.1.8__tar.gz → 0.1.9__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.8
3
+ Version: 0.1.9
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.8"
3
+ version = "0.1.9"
4
4
  description = "Parser combinator library"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -123,16 +123,16 @@ class GenState(Generic[T], Insptectable):
123
123
  def freeform(self) -> GenState[T]:
124
124
  return FreeformState(ast=None, seed=self.seed)
125
125
 
126
+
126
127
  @classmethod
127
128
  def from_ast(cls, ast: Optional[AST[T]], seed: int = 0) -> GenState[T]:
128
- return cls(ast=ast, seed=seed)
129
+ ret = cls(ast=ast, seed=seed)
130
+ return ret if ast is not None else ret.freeform()
131
+
129
132
 
130
133
  @classmethod
131
134
  def from_parse_result(cls, parse_result: Optional[ParseResult[T]], seed: int = 0) -> GenState[T]:
132
- ret = cls(ast=AST(parse_result) if parse_result else None, seed=seed)
133
- return ret if parse_result is not None else ret.freeform()
134
-
135
-
135
+ return cls.from_ast(AST(parse_result) if parse_result else None, seed)
136
136
 
137
137
 
138
138
  @dataclass(frozen=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.8
3
+ Version: 0.1.9
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