|
@@ -11,6 +11,7 @@ import org.openzen.zenscript.javashared.JavaField;
|
11
|
11
|
import org.openzen.zenscript.javashared.JavaMethod;
|
12
|
12
|
import org.openzen.zenscript.javashared.JavaParameterInfo;
|
13
|
13
|
|
|
14
|
+import javax.lang.model.element.VariableElement;
|
14
|
15
|
import java.util.ArrayList;
|
15
|
16
|
import java.util.HashMap;
|
16
|
17
|
import java.util.List;
|
|
@@ -85,9 +86,13 @@ public class JavaWriter {
|
85
|
86
|
public void setLocalVariable(VariableID variable, JavaLocalVariableInfo info) {
|
86
|
87
|
localVariables.put(variable, info);
|
87
|
88
|
}
|
88
|
|
-
|
|
89
|
+
|
|
90
|
+ public JavaLocalVariableInfo tryGetLocalVariable(VariableID variable) {
|
|
91
|
+ return localVariables.get(variable);
|
|
92
|
+ }
|
|
93
|
+
|
89
|
94
|
public JavaLocalVariableInfo getLocalVariable(VariableID variable) {
|
90
|
|
- JavaLocalVariableInfo result = localVariables.get(variable);
|
|
95
|
+ JavaLocalVariableInfo result = tryGetLocalVariable(variable);
|
91
|
96
|
if (result == null)
|
92
|
97
|
throw new IllegalStateException("Local variable unknown");
|
93
|
98
|
|