mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 00:14:10 -08:00
Fix generation of JS labels
This commit is contained in:
parent
6d3b329540
commit
c6d4265f8b
|
@ -216,7 +216,7 @@ public class RenderingContext {
|
|||
}
|
||||
|
||||
public String mainLoopName() {
|
||||
return minifying ? "$m" : "$main";
|
||||
return minifying ? "_" : "main";
|
||||
}
|
||||
|
||||
public String tempVarName() {
|
||||
|
|
|
@ -76,6 +76,7 @@ public final class RenderingUtil {
|
|||
public static String indexToId(int index) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(variableNames.charAt(index % variableNames.length()));
|
||||
index /= variableNames.length();
|
||||
while (index > 0) {
|
||||
sb.append(variablePartNames.charAt(index % variablePartNames.length()));
|
||||
index /= variablePartNames.length();
|
||||
|
|
|
@ -307,7 +307,7 @@ public class StatementRenderer implements ExprVisitor, StatementVisitor {
|
|||
String name = blockIdMap.get(id);
|
||||
if (name == null) {
|
||||
int index = blockIdMap.size();
|
||||
name = "$b" + RenderingUtil.indexToId(index);
|
||||
name = RenderingUtil.indexToId(index);
|
||||
blockIdMap.put(id, name);
|
||||
}
|
||||
return name;
|
||||
|
|
Loading…
Reference in New Issue
Block a user