Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions de.peeeq.wurstscript/parserspec/jass_im.parseq
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ ImMethod(@ignoreForEquality de.peeeq.wurstscript.ast.Element trace,
String name,
ref ImFunction implementation,
java.util.List<ImMethod> subMethods,
java.util.List<String> luaMethodDispatchAliases,
String luaDispatchGroupKey,
boolean isAbstract)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ public LuaCompilationUnit transformProgToLua() {
imProg.flatten(imTranslator);
timeTaker.endPhase();

beginPhase(13, "prepare lua dispatch");
LuaDispatchPreparation.prepare(imProg);
timeTaker.endPhase();

beginPhase(14, "translate to lua");
LuaTranslator luaTranslator = new LuaTranslator(imProg, imTranslator);
LuaCompilationUnit luaCode = luaTranslator.translate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private ImClass createClass() {
tr.getImProg().getFunctions().remove(impl);
c.getFunctions().add(impl);
ImClassType methodClass = JassIm.ImClassType(c, JassIm.ImTypeArguments());
ImMethod m = JassIm.ImMethod(e, methodClass, superMethod.getName(), impl, JassIm.ImMethods(), false);
ImMethod m = JassIm.ImMethod(e, methodClass, superMethod.getName(), impl, JassIm.ImMethods(), Lists.newArrayList(), "", false);
c.getMethods().add(m);

OverrideUtils.addOverrideClosure(tr, superMethod, m, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ public abstract class GetAForB<B, A> {
public abstract A initFor(B a);

public A getFor(B a) {
if (thing.containsKey(a)) {
return thing.get(a);
A existing = thing.get(a);
if (existing != null) {
return existing;
}
A b = initFor(a);
thing.put(a, b);
return b;
A created = initFor(a);
thing.put(a, created);
return created;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ public ImFunction initFor(StructureDef classDef) {
public ImMethod initFor(StructureDef classDef) {
ImFunction impl = destroyFunc.getFor(classDef);
ImMethod m = JassIm.ImMethod(classDef, selfType(classDef), "destroy" + classDef.getName(),
impl, Lists.newArrayList(), false);
impl, Lists.newArrayList(), Lists.newArrayList(), "", false);
return m;
}
};
Expand Down Expand Up @@ -2039,7 +2039,7 @@ public ImMethod getMethodFor(FuncDef f) {
// otherwise EliminateClasses dispatch lookup can fail.
String methodName = imFunc.getName();
WLogger.trace(() -> "[GENCAP] getMethodFor " + elementNameWithPath(f) + " -> methodName=" + methodName);
m = JassIm.ImMethod(f, selfType(f), methodName, imFunc, Lists.newArrayList(), false);
m = JassIm.ImMethod(f, selfType(f), methodName, imFunc, Lists.newArrayList(), Lists.newArrayList(), "", false);
methodForFuncDef.put(f, m);
}
return m;
Expand Down
Loading
Loading