1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 08:54:14 +03:00

Remove the outer bind in the lambda rule.

This commit is contained in:
Rob Rix 2017-10-06 10:49:25 -04:00
parent f22ed8fb9d
commit faf3215124

View File

@ -235,11 +235,11 @@ singletonMethod = makeTerm <$> symbol SingletonMethod <*> children (Declaration.
where params = symbol MethodParameters *> children (many parameter) <|> pure []
lambda :: Assignment
lambda = symbol Lambda >>= \ loc -> children $ do
lambda = makeTerm <$> symbol Lambda <*> children (do
name <- emptyTerm
params <- (symbol BlockParameters <|> symbol LambdaParameters) *> children (many parameter) <|> pure []
body <- expressions
pure $ makeTerm loc (Declaration.Function [] name params body)
pure (Declaration.Function [] name params body))
block :: Assignment
block = makeTerm <$> symbol DoBlock <*> children (Declaration.Function <$> pure [] <*> emptyTerm <*> params <*> expressions)