add method to get the value as a struct

This commit is contained in:
2020-03-05 22:42:43 +01:00
parent b9569c7df6
commit edaa686a2a

View File

@@ -1,6 +1,7 @@
package de.hsrm.compiler.Klang;
import de.hsrm.compiler.Klang.types.Type;
import java.util.Map;
public class Value {
public Type type;
@@ -30,4 +31,9 @@ public class Value {
public boolean asBoolean() {
return (boolean) this.value;
}
@SuppressWarnings("unchecked")
public Map<String, Value> asStruct() {
return (Map<String, Value>) this.value;
}
}