accept false in nixBool

This commit is contained in:
Daniel Bergey 2014-07-19 22:49:28 +00:00
parent a2a9dc32bf
commit 8111b111cd

View file

@ -70,7 +70,9 @@ nixInt :: Parser NExpr
nixInt = mkInt <$> decimal <?> "integer"
nixBool :: Parser NExpr
nixBool = try (mkBool . (== "true") <$> string "true") <?> "bool"
nixBool = try (true <|> false) <?> "bool" where
true = mkBool . (== "true") <$> string "true"
false =mkBool . (== "false") <$> string "false"
nixNull :: Parser NExpr
nixNull = try (mkNull <$ string "null") <?> "null"