From f8d0496bba49a8163608246a300628129c4c30e8 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Fri, 4 Jul 2014 13:31:11 +0200 Subject: [PATCH] Fix parsing of rec sets with reserved keyword --- Nix/Parser.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Nix/Parser.hs b/Nix/Parser.hs index 7e637ab..b5f331b 100644 --- a/Nix/Parser.hs +++ b/Nix/Parser.hs @@ -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 ()