Small change
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
i22007 2024-07-04 21:40:21 -04:00
parent 0de5c3e993
commit f5bccab651

View File

@ -267,7 +267,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
@Override @Override
public void visit(MemberAccessNode memberAccessNode) { public void visit(MemberAccessNode memberAccessNode) {
// Only used to get, not to put // Only used to get, not to put
int localVarIndex = localVariables.indexOf("memberAccessNode.identifier"); // TODO int localVarIndex = localVariables.indexOf("memberAccessNode.identifier"); // TODO: Anführungszeichen entfernen
if (localVarIndex >= 0) { // local var object if (localVarIndex >= 0) { // local var object
methodVisitor.visitVarInsn(ALOAD, localVarIndex); methodVisitor.visitVarInsn(ALOAD, localVarIndex);
} else { // this field } else { // this field
@ -388,7 +388,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
if (unaryNode.statement instanceof IncrementNode) { if (unaryNode.statement instanceof IncrementNode) {
IncrementNode incrementNode = (IncrementNode) unaryNode.statement; IncrementNode incrementNode = (IncrementNode) unaryNode.statement;
incrementNode.assignableExpression.typeNode = unaryNode.type; incrementNode.assignableExpression.typeNode = unaryNode.type;
loadInrement(incrementNode); loadIncrement(incrementNode);
} else if (unaryNode.statement instanceof DecrementNode) { } else if (unaryNode.statement instanceof DecrementNode) {
DecrementNode decrementNode = (DecrementNode) unaryNode.statement; DecrementNode decrementNode = (DecrementNode) unaryNode.statement;
decrementNode.assignableExpression.typeNode = unaryNode.type; decrementNode.assignableExpression.typeNode = unaryNode.type;
@ -454,7 +454,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
} }
} }
private void loadInrement(IncrementNode incrementNode) { private void loadIncrement(IncrementNode incrementNode) {
AssignableNode assignableNode = incrementNode.assignableExpression; AssignableNode assignableNode = incrementNode.assignableExpression;
if (assignableNode.memberAccess != null) { if (assignableNode.memberAccess != null) {
assignableNode.memberAccess.accept(this); assignableNode.memberAccess.accept(this);
@ -519,11 +519,11 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
if (incrementNode.crementType.equals(CrementType.PREFIX)) { // ++i if (incrementNode.crementType.equals(CrementType.PREFIX)) { // ++i
incrementNode.accept(this); incrementNode.accept(this);
incrementNode.assignableExpression.typeNode = unaryNode.getType(); incrementNode.assignableExpression.typeNode = unaryNode.getType();
loadInrement(incrementNode); loadIncrement(incrementNode);
assignLocalVar(assignNode); assignLocalVar(assignNode);
} else { // i++ } else { // i++
incrementNode.assignableExpression.typeNode = unaryNode.getType(); incrementNode.assignableExpression.typeNode = unaryNode.getType();
loadInrement(incrementNode); loadIncrement(incrementNode);
assignLocalVar(assignNode); assignLocalVar(assignNode);
incrementNode.accept(this); incrementNode.accept(this);
} }
@ -557,7 +557,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
if (unaryNode.statement instanceof IncrementNode) { if (unaryNode.statement instanceof IncrementNode) {
IncrementNode incrementNode = (IncrementNode) unaryNode.statement; IncrementNode incrementNode = (IncrementNode) unaryNode.statement;
incrementNode.assignableExpression.typeNode = unaryNode.getType(); incrementNode.assignableExpression.typeNode = unaryNode.getType();
loadInrement((incrementNode)); loadIncrement((incrementNode));
} else if (unaryNode.statement instanceof DecrementNode) { } else if (unaryNode.statement instanceof DecrementNode) {
DecrementNode decrementNode = (DecrementNode) unaryNode.statement; DecrementNode decrementNode = (DecrementNode) unaryNode.statement;
decrementNode.assignableExpression.typeNode = unaryNode.getType(); decrementNode.assignableExpression.typeNode = unaryNode.getType();
@ -685,7 +685,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
if (unaryNode.statement instanceof IncrementNode) { if (unaryNode.statement instanceof IncrementNode) {
IncrementNode incrementNode = (IncrementNode) unaryNode.statement; IncrementNode incrementNode = (IncrementNode) unaryNode.statement;
incrementNode.assignableExpression.typeNode = unaryNode.getType(); incrementNode.assignableExpression.typeNode = unaryNode.getType();
loadInrement(incrementNode); loadIncrement(incrementNode);
} }
if (unaryNode.statement instanceof DecrementNode) { if (unaryNode.statement instanceof DecrementNode) {
DecrementNode decrementNode = (DecrementNode) unaryNode.statement; DecrementNode decrementNode = (DecrementNode) unaryNode.statement;
@ -729,7 +729,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
} }
int localVarIndex = -1; int localVarIndex = -1;
if (methodCallNode.target.memberAccess.identifiers.size() > 1) { if (methodCallNode.target.memberAccess.identifiers.size() > 1) {
localVarIndex = localVariables.indexOf(methodCallNode.target.memberAccess.identifiers.get(1)); // TODO localVarIndex = localVariables.indexOf(methodCallNode.target.memberAccess.identifiers.get(1));
} }
if (localVarIndex >= 0) { // local var object if (localVarIndex >= 0) { // local var object
methodVisitor.visitVarInsn(ALOAD, localVarIndex); methodVisitor.visitVarInsn(ALOAD, localVarIndex);