File tree 2 files changed +11
-9
lines changed
main/kotlin/chapi/ast/goast
test/kotlin/chapi/ast/goast
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ class GoFullIdentListener(var fileName: String) : GoAstListener() {
105
105
" StructTypeContext" -> {
106
106
buildStruct(identifyName, typeChild)
107
107
}
108
+
108
109
else -> {
109
110
110
111
}
@@ -171,14 +172,16 @@ class GoFullIdentListener(var fileName: String) : GoAstListener() {
171
172
NodeName = primaryExprCtx.getChild(0 ).text
172
173
)
173
174
val argumentsContext = primaryExprCtx.getChild(1 ) as GoParser .ArgumentsContext
174
- for (expressionContext in argumentsContext.expressionList().expression()) {
175
- val codeProperty = CodeProperty (
176
- TypeValue = expressionContext.text,
177
- TypeType = " "
178
- )
179
- codeCall.Parameters + = codeProperty
175
+
176
+ if (argumentsContext.expressionList() != null ) {
177
+ for (expressionContext in argumentsContext.expressionList().expression()) {
178
+ codeCall.Parameters + = CodeProperty (
179
+ TypeValue = expressionContext.text,
180
+ TypeType = " "
181
+ )
182
+ }
183
+ currentFunction.FunctionCalls + = codeCall
180
184
}
181
- currentFunction.FunctionCalls + = codeCall
182
185
}
183
186
}
184
187
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test
6
6
internal class GoAnalyserTest {
7
7
@Test
8
8
fun analysis () {
9
- var helloworld = """
9
+ val helloworld = """
10
10
package main
11
11
import "fmt"
12
12
func main() {
@@ -17,7 +17,6 @@ func main() {
17
17
}
18
18
19
19
@Test
20
- @Ignore
21
20
fun analysis2 () {
22
21
val helloworldApi = """ package main
23
22
You can’t perform that action at this time.
0 commit comments