Merge pull request #1 from lethalman/master

Fix parsing of rec sets with reserved keyword
This commit is contained in:
John Wiegley 2014-07-04 15:43:30 -05:00
commit 74e1812f74

View file

@ -96,10 +96,10 @@ nixIf = Fix <$> (NIf
setLambdaStringOrSym :: Bool -> Parser NExpr setLambdaStringOrSym :: Bool -> Parser NExpr
setLambdaStringOrSym allowLambdas = do setLambdaStringOrSym allowLambdas = do
trace "setLambdaStringOrSym" $ return () trace "setLambdaStringOrSym" $ return ()
x <- try (lookAhead identifier) isSetOrArgs <- try (lookAhead (reserved "rec") *> pure True) <|>
<|> try (lookAhead (singleton <$> char '{')) try (lookAhead (singleton <$> char '{') *> pure True)
<|> return "" <|> pure False
if x == "rec" || x == "{" if isSetOrArgs
then setOrArgs then setOrArgs
else do else do
trace "might still have a lambda" $ return () trace "might still have a lambda" $ return ()