1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 10:27:45 +03:00

Merge branch 'master' into parse-error-symbols

This commit is contained in:
Rob Rix 2017-07-13 11:03:15 -04:00 committed by GitHub
commit 8546dc80b7

View File

@ -187,10 +187,11 @@ parameter = makeTerm <$> symbol DefaultParameter <*> children (Statement.Assign
makeAssignment loc identifier' value' = makeTerm loc (Statement.Assignment identifier' value')
decoratedDefinition :: Assignment
decoratedDefinition = makeTerm <$> symbol DecoratedDefinition <*> (children $ do
(a, b) <- (symbol Decorator *> (children ((,) <$> expression <*> (symbol ArgumentList *> children ((many expression) <|> (many emptyTerm))))))
dec <- declaration
pure (Declaration.Decorator a b dec))
decoratedDefinition = symbol DecoratedDefinition *> children (makeDecorator <$> partialDecorator <*> (flip (foldr makeDecorator) <$> many partialDecorator <*> declaration))
where
makeDecorator (loc, partialDecorator') next = makeTerm loc (partialDecorator' next)
partialDecorator = (,) <$> symbol Decorator <*> children decorator'
decorator' = Declaration.Decorator <$> expression <* symbol ArgumentList <*> children (many expression <|> many emptyTerm)
withStatement :: Assignment
withStatement = makeTerm <$> symbol WithStatement <*> (children $ do