add case0 to syntax since that is possible sometimes

This commit is contained in:
rhiannon morris 2023-04-02 15:22:39 +02:00
parent 3f3079c48d
commit 38dbd275a1
3 changed files with 3 additions and 3 deletions

View file

@ -185,7 +185,7 @@ reserved =
Sym "" `Or` Sym "::",
Punc1 '.',
Word1 "case",
Word1 "case1",
Word1 "case0", Word1 "case1",
Word "caseω" `Or` Word "case#",
Word1 "return",
Word1 "of",

View file

@ -165,7 +165,7 @@ lamIntro = symbolsC [(Lam, "λ"), (DLam, "δ")]
private covering
caseIntro : Grammar True Qty
caseIntro = symbols [(One, "case1"), (Any, "caseω")]
caseIntro = symbols [(Zero, "case0"), (One, "case1"), (Any, "caseω")]
<|> resC "case" *>
(qty <* resC "." <|>
fatalError {c = True} "missing quantity on 'case'")

View file

@ -100,7 +100,7 @@ tests = "lexer" :- [
lexes "caseω" [Reserved "caseω"],
lexes "case#" [Reserved "caseω"],
lexes "case1" [Reserved "case1"],
lexes "case0" [Name "case0"],
lexes "case0" [Reserved "case0"],
lexes "case##" [Name "case##"],
lexes "_" [Reserved "_"],