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

View File

@ -96,10 +96,10 @@ nixIf = Fix <$> (NIf
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 ()