mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
fixed true/false parsing
This commit is contained in:
parent
25c52d169d
commit
41ba5c10c5
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user