feat: tokenizer accepts braces, line terminator, and equal sign

This commit is contained in:
2025-12-27 19:52:18 -05:00
parent 0e185fbf41
commit c37e96770f
11 changed files with 107 additions and 61 deletions

View File

@@ -1,9 +1,16 @@
0 := \f x.x
(inc n) := \f x.(f (n f x))
(add n m) := (m inc n)
(mult n m) := (m (n f))
(exp m n) := (m n)
(true x y) := x
(false x y) := y
# This is the final output.
5 := (inc (inc (inc (inc (inc 0)))))
(exp 5 5)
(pair a b) := \c.(c a b)
(left p) := (p true)
(false p) := (p false)
zero 0 1 x = x
inc n := \0 1 x.{
initial := (pair true x)
(on_zero p) := (pair false ((left p 1 0) (right p)))
(on_one p) := (pair (left p) (1 (right p)))
(n on_zero on_one initial)
}