Skip to content

Commit

Permalink
fix(ts): fix array type error issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 17, 2022
1 parent 2782a01 commit c133707
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 @@ -598,6 +598,7 @@ arrayElement
bindingElement
: bindingPattern
| Identifier
| singleExpression
;


Expand Down Expand Up @@ -729,7 +730,7 @@ multipleExportElements
// Variable Statement

variableStatement
: accessibilityModifier? ReadOnly? varModifier (bindingPatternBlock | variableDeclarationList) SemiColon?
: accessibilityModifier? ReadOnly? varModifier (bindingPatternBlock | variableDeclarationList) eos?
;

varModifier
Expand All @@ -747,8 +748,9 @@ variableDeclarationList
;

variableDeclaration
// : ( identifierName | arrayLiteral | objectLiteral) typeAnnotation? ('=' typeParameters? singleExpression)? // ECMAScript 6: Array & Object Matching
: identifierName typeAnnotation? ('=' typeParameters? singleExpression)? // ECMAScript 6: Array & Object Matching
: identifierName typeAnnotation? ('=' typeParameters? singleExpression)? // ECMAScript 6: Array & Object Matching
| arrayLiteral
| objectLiteral
;


Expand Down Expand Up @@ -1016,6 +1018,8 @@ identifierOrKeyWord

identifierName
: reservedWord
| Lodash
| Dollar
| Identifier
;

Expand Down

0 comments on commit c133707

Please sign in to comment.