feat: tokenizer accepts braces, line terminator, and equal sign
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user