Zonk metas in functions, optional type signature on ptype

This commit is contained in:
2024-09-07 21:29:06 -07:00
parent f4cbde2c98
commit 391c9449ac
10 changed files with 89 additions and 17 deletions

View File

@@ -272,7 +272,14 @@ parseDef = do
export
parsePType : Parser Decl
parsePType = PType <$> getPos <* keyword "ptype" <*> uident
parsePType = do
fc <- getPos
keyword "ptype"
id <- uident
ty <- optional $ do
keyword ":"
mustWork typeExpr
pure $ PType fc id ty
parsePFunc : Parser Decl
parsePFunc = do