diff --git a/chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4 b/chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4 index 3b068698..ec6e5d39 100644 --- a/chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4 +++ b/chapi-ast-typescript/src/main/antlr/TypeScriptParser.g4 @@ -840,7 +840,7 @@ singleExpression | singleExpression '?'? '!'? '.'? '[' expressionSequence ']' # MemberIndexExpression // for: `onHotUpdateSuccess?.();` // onChange?.(userName || password || null) - | singleExpression ('?' | '!')* '.' '#'? identifierName? typeArguments? ('?' | '!')? # MemberDotExpression + | singleExpression ('?' | '!')* '.' '#'? identifierName typeArguments? ('?' | '!')? # MemberDotExpression // for: `onHotUpdateSuccess?.();` | singleExpression ('?' | '!')* '.' '#'? '(' identifierName? ')' ('?' | '!')? # MemberDotExpression // request('/api/system-info', { method: 'GET' }); diff --git a/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptAnalyserTest.kt b/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptAnalyserTest.kt index 9b019840..2564503d 100644 --- a/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptAnalyserTest.kt +++ b/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptAnalyserTest.kt @@ -61,7 +61,6 @@ class TypeScriptAnalyserTest { } @Test - @Disabled fun chai_define() { val content = this::class.java.getResource("/dts/index.d.ts")!!.readText() val codeFile = TypeScriptAnalyser().analysis(content, "/dts/index.d.ts") diff --git a/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptRegressionTest.kt b/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptRegressionTest.kt index 6f233329..c2118064 100644 --- a/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptRegressionTest.kt +++ b/chapi-ast-typescript/src/test/kotlin/chapi/ast/typescriptast/TypeScriptRegressionTest.kt @@ -190,7 +190,7 @@ export class PopupDirective { return '已完成'; } default: { - return ''; + return '';a } } }