File tree Expand file tree Collapse file tree
chapi-ast-typescript/src/main
kotlin/chapi/ast/typescriptast Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -444,11 +444,6 @@ constructorDeclaration
444444 : accessibilityModifier? Constructor ' (' formalParameterList? ' )' block?
445445 ;
446446
447- // propertyMemberDeclaration
448- // : abstractDeclaration
449- // | propertyMember
450- // ;
451-
452447propertyMemberDeclaration
453448 : propertyMemberBase propertyName ' !' ? ' ?' ? typeAnnotation? initializer? # PropertyDeclarationExpression
454449 | propertyMemberBase propertyName callSignature ( (' {' functionBody ' }' )) # MethodDeclarationExpression
@@ -457,7 +452,7 @@ propertyMemberDeclaration
457452 ;
458453
459454abstractDeclaration
460- : Abstract (Identifier ' ?' ? callSignature | variableStatement)
455+ : Abstract (identifierName ' ?' ? callSignature | variableStatement)
461456 ;
462457
463458// propertyMember
@@ -495,7 +490,7 @@ formalParameterList
495490 ;
496491
497492formalParameterArg
498- : decoratorList? accessibilityModifier? ReadOnly? identifierOrKeyWord ' ?' ? typeAnnotation? (' =' singleExpression)? // ECMAScript 6: Initialization
493+ : decoratorList? accessibilityModifier? ReadOnly? identifierName ' ?' ? typeAnnotation? (' =' singleExpression)? // ECMAScript 6: Initialization
499494 | lastFormalParameterArg
500495 // ([key, value]: [string, string[]])
501496// | arrayLiteral (':' formalParameterList)? // ECMAScript 6: Parameter Context Matching
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ open class TypeScriptAstListener : TypeScriptParserBaseListener() {
1515 for (argCtx in formalParameterListContext!! .formalParameterArg()) {
1616 val typeType = this .buildTypeAnnotation(argCtx.typeAnnotation())
1717 var typeValue = argCtx.text
18- if (argCtx.identifierOrKeyWord () != null ) {
19- typeValue = argCtx.identifierOrKeyWord ().text
18+ if (argCtx.identifierName () != null ) {
19+ typeValue = argCtx.identifierName ().text
2020 }
2121
22- val parameter = CodeProperty (TypeValue = typeValue, TypeType = typeType!! )
22+ val parameter = CodeProperty (TypeValue = typeValue, TypeType = typeType)
2323
2424 if (argCtx.accessibilityModifier() != null ) {
2525 parameter.Modifiers + = argCtx.accessibilityModifier().text
You can’t perform that action at this time.
0 commit comments