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
1 changed files with 4 additions and 4 deletions

View File

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