Skip to content
Snippets Groups Projects
Commit 11687c5c authored by Johannes Mey's avatar Johannes Mey
Browse files

make RefList compatible with current JastAdd. Fix bug with flushing the RefList

parent 0fd5656c
No related branches found
No related tags found
No related merge requests found
......@@ -31,18 +31,6 @@ aspect NTList {
}
}
ASTNode initial = inc_locateInitialCopy();
if (initial != null) {
state().enterConstruction();
if (i >= initial.numChildren) {
initial.addChild(node);
} else {
initial.setChild(node, i);
}
state().exitConstruction();
return;
}
}
if (children == null) {
children = new ASTNode[(i + 1 > 4 || !(this instanceof List)) ? i + 1 : 4];
......@@ -80,14 +68,6 @@ aspect NTList {
}
}
ASTNode initial = inc_locateInitialCopy();
if (initial != null) {
state().enterConstruction();
initial.insertChild(node, i);
state().exitConstruction();
return;
}
}
if (children == null) {
children = new ASTNode[(i + 1 > 4 || !(this instanceof List)) ? i + 1 : 4];
......@@ -127,14 +107,6 @@ aspect NTList {
}
}
ASTNode initial = inc_locateInitialCopy();
if (initial != null) {
state().enterConstruction();
initial.removeChild(i);
state().exitConstruction();
return;
}
}
ASTNode child = (ASTNode) children[i];
// rschoene: no check needed, as RefList is always a list
......@@ -165,6 +137,10 @@ aspect NTList {
return copy();
}
public void RefList.flushTreeCache() {
flushCache();
}
public RefList.RefList(T... initialChildren) {
children = new ASTNode[initialChildren.length];
for (int i = 0; i < children.length; ++i) {
......
......@@ -67,6 +67,10 @@ aspect NTList {
return copy();
}
public void RefList.flushTreeCache() {
flushCache();
}
public RefList.RefList(T... initialChildren) {
children = new ASTNode[initialChildren.length];
for (int i = 0; i < children.length; ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment