fixed true/false parsing

This commit is contained in:
Arya Irani 2018-06-05 17:49:49 -04:00
parent 25c52d169d
commit 41ba5c10c5
2 changed files with 4 additions and 7 deletions

View File

@ -134,10 +134,6 @@ pattern = traced "pattern" $ constructor <|> trace "running leaf" leaf
trace ("unknown data constructor " ++ name) $
(traced ("failing " ++ name) . fail $ "unknown data constructor " ++ name)
-- where literal = boolean
letBlock :: Var v => TermP v
letBlock = token (string "let") *> block
@ -155,7 +151,7 @@ term4 = traced "apply-chain" $ f <$> some termLeaf
termLeaf :: Var v => TermP v
termLeaf = traced "leaf" $
asum [hashLit, prefixTerm, text, number, tupleOrParenthesized term, blank, vector term]
asum [hashLit, prefixTerm, text, number, boolean, tupleOrParenthesized term, blank, vector term]
ifthen :: Var v => TermP v
ifthen = do
@ -285,6 +281,7 @@ keywords =
, "if", "then", "else"
, "namespace"
, "type", "effect", "where"
, "true", "false"
]
block' :: Var v => Parser (S v) () -> TermP v

View File

@ -3,8 +3,8 @@ type Optional a = None | Some a
Optional.isEmpty : ∀ a . Optional a -> Boolean
Optional.isEmpty o = case o of
Optional.None -> 1
_ -> 0
Optional.None -> true
_ -> false
increment x = x +_UInt64 1