Skip to content

Commit

Permalink
fix(ts): fix function error issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 17, 2022
1 parent b86d867 commit 4640f34
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,6 @@ singleExpression
| singleExpression ('.' | '?''.') identifierName # PropertyAccessExpression
| New (Dot Target| singleExpression ) # NewExpression
// find arguments first, then found the call expression
// | singleExpression typeArguments? arguments # ArgumentsExpression
| '(' expressionSequence ')' # ParenthesizedExpression

// TODO:
Expand All @@ -914,17 +913,22 @@ singleExpression

| This # ThisExpression
| Super # SuperExpression
| identifierName # IdentifierExpression
| typeArguments? identifierName # IdentifierExpression
| literal # LiteralExpression
| arrayLiteral # ArrayLiteralExpression
| objectLiteral # ObjectLiteralExpression
| templateStringLiteral # TemplateStringExpression
| singleExpression As asExpression # CastAsExpression

// TODO: careful use those
| singleExpression typeArguments? arguments # ArgumentsExpression
| htmlElements # HtmlElementExpression
;



asExpression
: singleExpression
;

functionExpression
: Function '*'? Identifier? '(' formalParameterList? ')' typeAnnotation? '{' functionBody '}'
Expand Down

0 comments on commit 4640f34

Please # to comment.