1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00

Reuse the expressions assignment.

This commit is contained in:
Rob Rix 2017-08-14 14:44:15 -04:00
parent 70e83e215f
commit a1fd6c9ad9

View File

@ -233,12 +233,12 @@ whileStatement = symbol WhileStatement >>= \ loc -> children (make loc <$> expre
tryStatement :: Assignment
tryStatement = makeTerm <$> symbol TryStatement <*> children (Statement.Try <$> expression <*> many (expression <|> elseClause))
where elseClause = makeTerm <$> symbol ElseClause <*> children (Statement.Else <$> emptyTerm <*> (makeTerm <$> location <*> many expression))
where elseClause = makeTerm <$> symbol ElseClause <*> children (Statement.Else <$> emptyTerm <*> expressions)
exceptClause :: Assignment
exceptClause = makeTerm <$> symbol ExceptClause <*> children
(Statement.Catch <$> ((makeTerm <$> location <*> (uncurry (flip Statement.Let) <$> ((,) <$> expression <* symbol AnonAs <*> expression) <*> emptyTerm))
<|> makeTerm <$> location <*> many expression)
<|> expressions)
<*> expressions)
functionDefinition :: Assignment