Fixed syntaxtreegenerator to determine correct receiver of methodcall
This commit is contained in:
parent
89a791b81e
commit
81e19f5315
@ -468,7 +468,7 @@ public class StatementGenerator {
|
|||||||
case PrimaryexpressionContext primary:
|
case PrimaryexpressionContext primary:
|
||||||
return convert(primary.primary());
|
return convert(primary.primary());
|
||||||
case DottedexpressionContext dotted:
|
case DottedexpressionContext dotted:
|
||||||
return convert((DottedexpressionContext) expression, expression.getStart());
|
return convert(dotted, expression.getStart());
|
||||||
case MethodcallexpressionContext methodcall:
|
case MethodcallexpressionContext methodcall:
|
||||||
return convert(methodcall.methodCall(), methodcall.getStart());
|
return convert(methodcall.methodCall(), methodcall.getStart());
|
||||||
case NewinstanceexpressionContext newinstance:
|
case NewinstanceexpressionContext newinstance:
|
||||||
@ -518,10 +518,6 @@ public class StatementGenerator {
|
|||||||
private Expression convert(DottedexpressionContext expr, Token offset) {
|
private Expression convert(DottedexpressionContext expr, Token offset) {
|
||||||
if (!Objects.isNull(expr.methodCall())) {
|
if (!Objects.isNull(expr.methodCall())) {
|
||||||
return convert(expr.methodCall(), expr.expression(), offset);
|
return convert(expr.methodCall(), expr.expression(), offset);
|
||||||
} else if (!Objects.isNull(expr.THIS())) {
|
|
||||||
return new This(offset);
|
|
||||||
} else if (!Objects.isNull(expr.NEW()) && Objects.isNull(expr.nonWildcardTypeArguments())) {
|
|
||||||
return convert(expr.innerCreator());
|
|
||||||
} else if (!Objects.isNull(expr.identifier())) {
|
} else if (!Objects.isNull(expr.identifier())) {
|
||||||
return generateLocalOrFieldVarOrClassName(expr.getText(), offset);
|
return generateLocalOrFieldVarOrClassName(expr.getText(), offset);
|
||||||
} else {
|
} else {
|
||||||
@ -567,7 +563,7 @@ public class StatementGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Receiver getReceiver(ExpressionContext expr) {
|
public Receiver getReceiver(ExpressionContext expr) {
|
||||||
Expression expression = generateLocalOrFieldVarOrClassName(expr.getText(), expr.getStart());
|
Expression expression = convert(expr);
|
||||||
/*
|
/*
|
||||||
* if (expr instanceof PrimaryexpressionContext pc) { expression = convert(pc.primary()); } else { expression = generateLocalOrFieldVarOrClassName(expr.getText(), expr.getStart()); }
|
* if (expr instanceof PrimaryexpressionContext pc) { expression = convert(pc.primary()); } else { expression = generateLocalOrFieldVarOrClassName(expr.getText(), expr.getStart()); }
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user