fix identifiermovement bug
This commit is contained in:
@ -224,6 +224,7 @@ public final class ASTCompacter {
|
|||||||
root.getChildren().remove(op);
|
root.getChildren().remove(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Jede Expression hat maximal 1x Operator
|
||||||
private static ASTNode getOp(ASTNode root) {
|
private static ASTNode getOp(ASTNode root) {
|
||||||
for (ASTNode child : root.getChildren()) {
|
for (ASTNode child : root.getChildren()) {
|
||||||
ASTNode op = switch (child.getName()) {
|
ASTNode op = switch (child.getName()) {
|
||||||
@ -263,13 +264,16 @@ public final class ASTCompacter {
|
|||||||
root.getChildren().remove(id);
|
root.getChildren().remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assignments koennen >1 Identifier haben: Wenn ja, nimm den 2.
|
||||||
private static ASTNode getId(ASTNode root) {
|
private static ASTNode getId(ASTNode root) {
|
||||||
|
ASTNode childOut = null;
|
||||||
|
|
||||||
for (ASTNode child : root.getChildren()) {
|
for (ASTNode child : root.getChildren()) {
|
||||||
if (child.getName().equals("IDENTIFIER")) {
|
if ("IDENTIFIER".equals(child.getName())) {
|
||||||
return child;
|
childOut = child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return childOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user