diff --git a/src/Lib/Parser.newt b/src/Lib/Parser.newt index 59e8c59..d515ee3 100644 --- a/src/Lib/Parser.newt +++ b/src/Lib/Parser.newt @@ -285,28 +285,16 @@ letExpr = do pure (name,fc,ty,t) pLamArg : Parser (Icit × String × Maybe Raw) -pLamArg = impArg <|> autoArg <|> expArg +pLamArg = impArg <|> expArg <|> (\ x => (Explicit, x, Nothing)) <$> (ident <|> uident) <|> keyword "_" *> pure (Explicit, "_", Nothing) where + -- TODO - we're moving away from uppercase variables, but a test uses them impArg : Parser (Icit × String × Maybe Raw) - impArg = do - nm <- braces (ident <|> uident) - ty <- optional (symbol ":" >> typeExpr) - pure (Implicit, nm, ty) - - autoArg : Parser (Icit × String × Maybe Raw) - autoArg = do - nm <- dbraces (ident <|> uident) - ty <- optional (symbol ":" >> typeExpr) - pure (Auto, nm, ty) + impArg = (Implicit, ) <$> braces (_,_ <$> (ident <|> uident) <*> optional (symbol ":" >> typeExpr)) expArg : Parser (Icit × String × Maybe Raw) - expArg = do - nm <- parenWrap (ident <|> uident) - -- FIXME - this is broken, outside parenWrap, guess I never used it? - ty <- optional (symbol ":" >> typeExpr) - pure (Explicit, nm, ty) + expArg = (Explicit , ) <$> parenWrap (_,_ <$> ident <*> optional (symbol ":" >> typeExpr)) lamExpr : Parser Raw lamExpr = do diff --git a/tests/LambdaArg.newt b/tests/LambdaArg.newt new file mode 100644 index 0000000..4d0a17b --- /dev/null +++ b/tests/LambdaArg.newt @@ -0,0 +1,7 @@ +module LambdaArg + +import Prelude + +-- Parsing of typed arguments on lambda +foo : Nat -> ({_ : U} -> Nat -> Nat) +foo x = \ {x : U} (x : Nat) => x