From aaf2ef628772e5789203544ac6226b467891d1d9 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 30 Aug 2022 21:02:24 +0100 Subject: Boolean type, and true/false symbols --- src/Parser.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Parser.hs') diff --git a/src/Parser.hs b/src/Parser.hs index 41f2ba3..ea698c8 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -27,6 +27,18 @@ number = do n <- integer return $ Num n pos +true :: Parser Expr +true = do + pos <- getPosition + reserved "true" + return $ Bool' True pos + +false :: Parser Expr +false = do + pos <- getPosition + reserved "false" + return $ Bool' False pos + variable :: Parser Expr variable = do pos <- getPosition @@ -107,6 +119,8 @@ call = do factor :: Parser Expr factor = number + <|> true + <|> false <|> try call <|> try lambda <|> try variable -- cgit v1.2.3