mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Parse expression and type params in the right order
This commit is contained in:
parent
b119fc1ef8
commit
acad9e9222
@ -555,8 +555,9 @@ literal =
|
||||
<|> makeTerm <$> symbol Regex <*> (Literal.TextElement <$> source)
|
||||
|
||||
class' :: Assignment
|
||||
class' = makeTerm <$> symbol Class <*> children (Declaration.Class <$> expression <*> (many typeParameter' <|> pure []) <*> (superclass <|> pure []) <*> classBodyStatements)
|
||||
class' = makeClass <$> symbol Class <*> children ((,,,) <$> expression <*> (many typeParameter' <|> pure []) <*> (superclass <|> pure []) <*> classBodyStatements)
|
||||
where superclass = pure <$ symbol Grammar.ClassHeritage <*> children expression
|
||||
makeClass loc (expression, typeParams, superclass', statements) = makeTerm loc (Declaration.Class typeParams expression superclass' statements)
|
||||
|
||||
object :: Assignment
|
||||
object = makeTerm <$> symbol Object <*> children (Literal.Hash <$> many (pair <|> spreadElement <|> methodDefinition <|> assignmentPattern <|> shorthandReservedIdentifier))
|
||||
|
Loading…
Reference in New Issue
Block a user