update syntax.ebnf
This commit is contained in:
parent
e48f03a61c
commit
8b8129027d
1 changed files with 11 additions and 4 deletions
15
syntax.ebnf
15
syntax.ebnf
|
@ -24,7 +24,7 @@ dim arg = "@", dim.
|
|||
|
||||
pat var = NAME | "_".
|
||||
|
||||
term = lambda | case | pi | sigma | ann.
|
||||
term = lambda | pi | sigma | ann | let.
|
||||
|
||||
lambda = ("λ" | "δ"), {pat var}+, "⇒", term.
|
||||
|
||||
|
@ -49,12 +49,18 @@ sigma = (binder | ann), "×", (sigma | ann).
|
|||
|
||||
ann = infix eq, ["∷", term].
|
||||
|
||||
bare let binder = pat var, "=", term.
|
||||
qty let binder = [qty, "."], bare let binder.
|
||||
|
||||
let = ("let0" | "let1" | "letω"), {bare let binder / ";"}+, "in", term
|
||||
| "let", {qty let binder / ";"}+, "in", term.
|
||||
|
||||
infix eq = app term, ["≡", term, ":", app term]. (* dependent is below *)
|
||||
|
||||
app term = coe | comp | split universe | dep eq | succ | normal app.
|
||||
app term = coe | comp | split universe | dep eq | special app | normal app.
|
||||
split universe = "★", NAT.
|
||||
dep eq = "Eq", type line, term arg, term arg.
|
||||
succ = "succ", term arg.
|
||||
special app = ("fst" | "snd" | "succ"), {term arg}+.
|
||||
normal app = term arg, {term arg | dim arg}.
|
||||
|
||||
(* direction defaults to @0 @1 *)
|
||||
|
@ -76,4 +82,5 @@ term arg = UNIVERSE | "★", SUPER
|
|||
| "zero"
|
||||
| NAT
|
||||
| QNAME, displacement
|
||||
| "(", {term / ","}+, [","], ")".
|
||||
| "(", {term / ","}+, [","], ")"
|
||||
| case.
|
||||
|
|
Loading…
Add table
Reference in a new issue