refactor: fix duplicate function call issue

上级 cf50e98a
......@@ -152,21 +152,21 @@ open class PythonAstBaseListener : PythonParserBaseListener() {
var funcCalls: Array<CodeCall> = arrayOf()
val atomName = exprCtx.atom().text
for (trailerContext in exprCtx.trailer()) {
var caller = ""
var nodeName = ""
if (trailerContext.DOT() != null) {
var caller = ""
if (trailerContext.name() != null) {
caller = trailerContext.name().text
}
funcCalls += CodeCall(
NodeName = atomName,
FunctionName = caller
)
nodeName = atomName
} else {
funcCalls += CodeCall(
NodeName = "",
FunctionName = atomName
)
caller = atomName
}
funcCalls += CodeCall(
NodeName = nodeName,
FunctionName = caller
)
}
currentFunction.FunctionCalls = funcCalls
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册