Fix parsing of rec sets with reserved keyword

This commit is contained in:
Luca Bruno 2014-07-04 13:31:11 +02:00
parent f5ab0e5be4
commit f8d0496bba

View file

@ -89,10 +89,10 @@ nixLet = (Fix .) . NLet
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 ()