add box patterns to the parser oops

This commit is contained in:
rhiannon morris 2023-04-01 15:59:16 +02:00
parent a17752f31c
commit 1fce4d80f6

View file

@ -194,6 +194,7 @@ mutual
caseBody : Grammar True PCaseBody caseBody : Grammar True PCaseBody
caseBody = braces $ caseBody = braces $
[|CasePair (pairPat <* darr) (term <* optSemi)|] [|CasePair (pairPat <* darr) (term <* optSemi)|]
<|> [|CaseBox (bracks bname <* darr) (term <* optSemi)|]
<|> CaseNat <$> zeroCase <* resC ";" <*> succCase <* optSemi <|> CaseNat <$> zeroCase <* resC ";" <*> succCase <* optSemi
<|> flip CaseNat <$> succCase <* resC ";" <*> zeroCase <* optSemi <|> flip CaseNat <$> succCase <* resC ";" <*> zeroCase <* optSemi
<|> [|CaseEnum $ semiSep [|MkPair tag (darr *> term)|]|] <|> [|CaseEnum $ semiSep [|MkPair tag (darr *> term)|]|]