At patterns on LHS

This commit is contained in:
2024-12-14 19:58:52 -08:00
parent 00a8678bd4
commit d22f3844f6
7 changed files with 63 additions and 30 deletions

View File

@@ -74,10 +74,20 @@ export term : (Parser Raw)
withPos : Parser a -> Parser (FC, a)
withPos pa = (,) <$> getPos <*> pa
asAtom : Parser Raw
asAtom = do
fc <- getPos
nm <- ident
asPat <- optional $ keyword "@" *> parens typeExpr
case asPat of
Just exp => pure $ RAs fc nm exp
Nothing => pure $ RVar fc nm
-- the inside of Raw
atom : Parser Raw
atom = RU <$> getPos <* keyword "U"
<|> RVar <$> getPos <*> ident
-- <|> RVar <$> getPos <*> ident
<|> asAtom
<|> RVar <$> getPos <*> uident
<|> lit
<|> RImplicit <$> getPos <* keyword "_"