tinyprove 0.1.5__tar.gz → 0.1.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinyprove
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Tiny CoC-based theorem prover with inductive types
5
5
  Project-URL: Homepage, https://github.com/pb1729/tinyprove
6
6
  Project-URL: Repository, https://github.com/pb1729/tinyprove
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tinyprove"
7
- version = "0.1.5"
7
+ version = "0.1.6"
8
8
  description = "Tiny CoC-based theorem prover with inductive types"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -16,14 +16,23 @@ _token_re = re.compile(
16
16
  [\[\]()\|,:=λΠδι]| # punctuation (unicode lambdas, etc.)
17
17
  """ + _ident_re + """ # identifiers
18
18
  )
19
+ \s* # skip trailing whitespace
19
20
  """,
20
21
  re.VERBOSE,
21
22
  )
22
23
 
23
24
 
24
25
  def _tokenise(src: str) -> List[str]:
25
- """Return a *list* of string tokens (whitespace already stripped)."""
26
- return [m.group(1) for m in _token_re.finditer(src)]
26
+ """ Return a list of string tokens (whitespace already stripped). """
27
+ pos = 0
28
+ ans = []
29
+ while pos < len(src):
30
+ m = _token_re.match(src, pos)
31
+ if not m:
32
+ raise SyntaxError(f"Unexpected character at position {pos}: {repr(src[pos])}")
33
+ ans.append(m.group(1))
34
+ pos = m.end()
35
+ return ans
27
36
 
28
37
 
29
38
  def strip_comments(src:str) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinyprove
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Tiny CoC-based theorem prover with inductive types
5
5
  Project-URL: Homepage, https://github.com/pb1729/tinyprove
6
6
  Project-URL: Repository, https://github.com/pb1729/tinyprove
@@ -288,7 +288,7 @@ test("1 != 0",
288
288
  (Eq.ind.0 Nat (Nat.S Nat.Z)
289
289
  (λ y: Nat -> λ instance: (Eq Nat (Nat.S Nat.Z) y) -> (isSucc y)) # motive
290
290
  Unit.in # case refl : isSucc 1, reduces to Unit
291
- Nat.Z" # y := 0
291
+ Nat.Z # y := 0
292
292
  p
293
293
  )
294
294
  """
File without changes
File without changes
File without changes