A parser for a toy strict untyped λ-calculus language called L-lang.
You may view the syntax of L-lang in l.pest.
There's an example L-lang program called examples/evenb.l.
$ l-lang-parser-rs export run.l
Definition my_evenb: tm :=
(rec (abs "my_evenb"
(abs "n"
(mat (var "n") [
("S", ["x"],
(mat (var "x") [
("S", ["x"],
(app (var "my_evenb") (var "x")));
("O", [],
(const "false"))
]));
("O", [],
(const "true"))
])
)
)).
Definition main: tm :=
(app my_evenb (app (const "S") (app (const "S") (app (const "S") (app (const "S") (const "O")))))).
$ l-lang-parser-rs export run.l
= Some (const "true")
: option tm
This project is licensed under the Apache License 2.0.