AS3 test methods separated to classes, Fixed AS3: get/set slot for global scope

This commit is contained in:
Jindra Petřík
2021-01-18 19:14:51 +01:00
parent 17c1cf528d
commit 9c38f4dca1
94 changed files with 1999 additions and 138 deletions

View File

@@ -724,6 +724,7 @@ public class Graph {
lastUsage.get(labelName).labelName = null;
}
}
expandGotos(ret);
processIfs(ret);
finalProcessStack(stack, ret, path);
finalProcessAll(ret, 0, new FinalProcessLocalData(loops), path);
@@ -1203,16 +1204,6 @@ public class Graph {
}
protected void finalProcessAfter(List<GraphTargetItem> list, int level, FinalProcessLocalData localData, String path) {
if (!list.isEmpty() && (list.get(list.size() - 1) instanceof GotoItem)) {
GotoItem gi = (GotoItem) list.get(list.size() - 1);
if (gi.targetCommands != null) {
list.remove(gi);
if (gi.labelName != null) {
list.add(new LabelItem(null, gi.lineStartItem, gi.labelName));
}
list.addAll(gi.targetCommands);
}
}
if (list.size() >= 2) {
if (list.get(list.size() - 1) instanceof ExitItem) {
ExitItem e = (ExitItem) list.get(list.size() - 1);
@@ -1306,6 +1297,28 @@ public class Graph {
}
}
private void expandGotos(List<GraphTargetItem> list) {
if (!list.isEmpty() && (list.get(list.size() - 1) instanceof GotoItem)) {
GotoItem gi = (GotoItem) list.get(list.size() - 1);
if (gi.targetCommands != null) {
list.remove(gi);
if (gi.labelName != null) {
list.add(new LabelItem(null, gi.lineStartItem, gi.labelName));
}
list.addAll(gi.targetCommands);
}
}
for (int i = 0; i < list.size(); i++) {
GraphTargetItem item = list.get(i);
if (item instanceof Block) {
List<List<GraphTargetItem>> subs = ((Block) item).getSubs();
for (List<GraphTargetItem> sub : subs) {
expandGotos(sub);
}
}
}
}
private void processIfs(List<GraphTargetItem> list) {
for (int i = 0; i < list.size(); i++) {
GraphTargetItem item = list.get(i);