Merge pull request #15 from bennofs/lambda-less-try

Limit scope of 'try' for lambda
This commit is contained in:
John Wiegley 2014-08-16 12:17:57 -05:00
commit 732171c22c
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ nixTerm = choice
, nixBool
, nixNull
, nixPath -- can be expensive due to back-tracking
, try nixLambda <|> nixSet
, nixLambda <|> nixSet
, nixStringExpr
, nixSym
] <* whiteSpace
@ -118,7 +118,7 @@ nixIf = fmap Fix $ NIf
<*> (whiteSpace *> reserved "else" *> nixApp)
nixLambda :: Parser NExpr
nixLambda = Fix <$> (NAbs <$> (argExpr <?> "arguments") <*> nixApp)
nixLambda = Fix <$> (NAbs <$> (try argExpr <?> "arguments") <*> nixApp)
nixStringExpr :: Parser NExpr
nixStringExpr = Fix . NStr <$> nixString