Open panjea opened 1 year ago
my temp workaround:
before:
def visitMethodCall(self, ctx: JavaParser.MethodCallContext):
fname = ctx.IDENTIFIER().getText()
args = ctx.expressionList()
args = [args.expression(i) for i in range(args.getChildCount())]
args_str = ",".join([self.visit(a) for a in args])
return f"{fname}({args_str})"
quick fix:
def visitMethodCall(self, ctx: JavaParser.MethodCallContext):
fname = ctx.IDENTIFIER().getText()
exl = ctx.expressionList()
if exl is None:
args_str = ''
else:
args = []
for i in range(exl.getChildCount()):
a = exl.expression(i)
if a is not None:
args.append( a )
args_str = ",".join([self.visit(a) for a in args])
return f"{fname}({args_str})"
Description
translate a very large java file
ERROR