Skip to content

Commit

Permalink
fix(ts): fix await issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 17, 2022
1 parent 9a8d927 commit db90510
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -878,13 +878,11 @@ singleExpression
| iteratorBlock # IteratorsExpression // ECMAScript 6
| generatorBlock # GeneratorsExpression // ECMAScript 6
| generatorFunctionDeclaration # GeneratorsFunctionExpression // ECMAScript 6
| yieldStatement # YieldExpression // ECMAScript 6
| Await singleExpression # AwaitExpression

// TODO: careful use those
| singleExpression '(' (argumentList ','?)? ')' # ArgumentsExpression
// RealtionExpression will have conflict
| singleExpression '<' typeArgumentList '>' '(' (argumentList ','?)? ')'# ArgumentsExpression
| singleExpression '<' typeArgumentList '>' '(' (argumentList ','?)? ')' # ArgumentsExpression

// respect precedence by order of sub-rules
| singleExpression assignmentOperator singleExpression # AssignmentExpression
Expand Down Expand Up @@ -922,6 +920,8 @@ singleExpression

| This # ThisExpression
| Super # SuperExpression
| yieldStatement # YieldExpression // ECMAScript 6
| Await singleExpression # AwaitExpression
| typeArguments? identifierName singleExpression? # IdentifierExpression
| typeArguments expressionSequence? # GenericTypes
| literal # LiteralExpression
Expand Down

0 comments on commit db90510

Please sign in to comment.