File tree Expand file tree Collapse file tree 2 files changed +0
-20
lines changed
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation Expand file tree Collapse file tree 2 files changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -482,11 +482,6 @@ private boolean isInlineCandidate(ImFunction f) {
482482 // this is only relevant for lua, because in JASS they are eliminated before inlining
483483 return false ;
484484 }
485- if (translator .luaInitFunctions .containsKey (f )) {
486- // Lua package init functions must stay as ImFunctionCall nodes so StmtTranslation
487- // can wrap them in xpcall. Inlining removes the call site and loses the guard.
488- return false ;
489- }
490485 return true ;
491486 }
492487
Original file line number Diff line number Diff line change @@ -324,27 +324,12 @@ public LuaCompilationUnit translate() {
324324 }
325325
326326 prependDeferredMainInitToMain ();
327- moveEntrypointToEnd ("main" );
328- moveEntrypointToEnd ("config" );
329327 cleanStatements ();
330328 enforceLuaLocalLimits ();
331329
332330 return luaModel ;
333331 }
334332
335- /** Move a named WC3 entrypoint function (main/config) to the end of the model so all
336- * helpers it calls are defined before it in the file. */
337- private void moveEntrypointToEnd (String funcName ) {
338- for (int i = 0 ; i < luaModel .size (); i ++) {
339- LuaStatement s = luaModel .get (i );
340- if (s instanceof LuaFunction && ((LuaFunction ) s ).getName ().equals (funcName )) {
341- luaModel .remove (i );
342- luaModel .add (s );
343- return ;
344- }
345- }
346- }
347-
348333 /**
349334 * Always emit internal hashtable helper functions used by Lua lowering.
350335 * This keeps compiletime migration data loading robust even if the
You can’t perform that action at this time.
0 commit comments