mirror of
https://github.com/github/semantic.git
synced 2025-01-01 11:46:14 +03:00
Add annotatedType
and add back catchType to catchFormalParameter Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
This commit is contained in:
parent
a3679cfd8b
commit
bc8e1ff1ec
@ -66,12 +66,14 @@ type Syntax =
|
|||||||
, Expression.Member
|
, Expression.Member
|
||||||
, Expression.Super
|
, Expression.Super
|
||||||
, Expression.This
|
, Expression.This
|
||||||
|
, Java.Syntax.AnnotatedType
|
||||||
, Java.Syntax.Annotation
|
, Java.Syntax.Annotation
|
||||||
, Java.Syntax.AnnotationField
|
, Java.Syntax.AnnotationField
|
||||||
, Java.Syntax.AnnotationTypeElement
|
, Java.Syntax.AnnotationTypeElement
|
||||||
, Java.Syntax.ArrayCreationExpression
|
, Java.Syntax.ArrayCreationExpression
|
||||||
, Java.Syntax.AssertStatement
|
, Java.Syntax.AssertStatement
|
||||||
, Java.Syntax.Asterisk
|
, Java.Syntax.Asterisk
|
||||||
|
, Java.Syntax.CatchType
|
||||||
, Java.Syntax.Constructor
|
, Java.Syntax.Constructor
|
||||||
, Java.Syntax.ClassBody
|
, Java.Syntax.ClassBody
|
||||||
, Java.Syntax.ClassLiteral
|
, Java.Syntax.ClassLiteral
|
||||||
@ -408,9 +410,13 @@ type' = choice [
|
|||||||
, typeIdentifier
|
, typeIdentifier
|
||||||
, generic
|
, generic
|
||||||
, typeArgument
|
, typeArgument
|
||||||
|
, annotatedType
|
||||||
]
|
]
|
||||||
where array = foldl (\into each -> makeTerm1 (Type.Array (Just each) into))
|
where array = foldl (\into each -> makeTerm1 (Type.Array (Just each) into))
|
||||||
|
|
||||||
|
annotatedType :: Assignment Term
|
||||||
|
annotatedType = makeTerm <$> symbol AnnotatedType <*> children (Java.Syntax.AnnotatedType <$> many annotation <*> type')
|
||||||
|
|
||||||
typeArgument :: Assignment Term
|
typeArgument :: Assignment Term
|
||||||
typeArgument = symbol TypeArgument *> children (term type')
|
typeArgument = symbol TypeArgument *> children (term type')
|
||||||
|
|
||||||
@ -454,7 +460,10 @@ catches :: Assignment [Term]
|
|||||||
catches = symbol Catches *> children (manyTerm catch)
|
catches = symbol Catches *> children (manyTerm catch)
|
||||||
where
|
where
|
||||||
catch = makeTerm <$> symbol CatchClause <*> children (Statement.Catch <$> catchFormalParameter <*> term expression)
|
catch = makeTerm <$> symbol CatchClause <*> children (Statement.Catch <$> catchFormalParameter <*> term expression)
|
||||||
catchFormalParameter = makeTerm <$> symbol CatchFormalParameter <*> children (flip Type.Annotation <$> type' <* symbol VariableDeclaratorId <*> children identifier)
|
catchFormalParameter = makeTerm <$> symbol CatchFormalParameter <*> children (flip Type.Annotation <$> catchType <* symbol VariableDeclaratorId <*> children identifier)
|
||||||
|
|
||||||
|
catchType :: Assignment Term
|
||||||
|
catchType = makeTerm <$> symbol CatchType <*> (Java.Syntax.CatchType <$> many type')
|
||||||
|
|
||||||
finally :: Assignment Term
|
finally :: Assignment Term
|
||||||
finally = makeTerm <$> symbol Finally <*> children (Statement.Finally <$> term expression)
|
finally = makeTerm <$> symbol Finally <*> children (Statement.Finally <$> term expression)
|
||||||
|
Loading…
Reference in New Issue
Block a user