File tree Expand file tree Collapse file tree
chapi-ast-typescript/src/main/antlr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -905,7 +905,6 @@ singleExpression
905905 | singleExpression (' .' | ' ?' ' .' ) identifierName # PropertyAccessExpression
906906 | New (Dot Target| singleExpression ) # NewExpression
907907 // find arguments first, then found the call expression
908- // | singleExpression typeArguments? arguments # ArgumentsExpression
909908 | ' (' expressionSequence ' )' # ParenthesizedExpression
910909
911910 // TODO:
@@ -914,17 +913,22 @@ singleExpression
914913
915914 | This # ThisExpression
916915 | Super # SuperExpression
917- | identifierName # IdentifierExpression
916+ | typeArguments? identifierName # IdentifierExpression
918917 | literal # LiteralExpression
919918 | arrayLiteral # ArrayLiteralExpression
920919 | objectLiteral # ObjectLiteralExpression
921920 | templateStringLiteral # TemplateStringExpression
921+ | singleExpression As asExpression # CastAsExpression
922922
923+ // TODO: careful use those
924+ | singleExpression typeArguments? arguments # ArgumentsExpression
923925 | htmlElements # HtmlElementExpression
924926 ;
925927
926928
927-
929+ asExpression
930+ : singleExpression
931+ ;
928932
929933functionExpression
930934 : Function ' *' ? Identifier? ' (' formalParameterList? ' )' typeAnnotation? ' {' functionBody ' }'
You can’t perform that action at this time.
0 commit comments