mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-19 11:49:05 +00:00
- Basic types can now be converted to the "any" type
- Changed OreDict 'contains' to respond to the 'in' operator
This commit is contained in:
1 parent
52f92dcfd4
commit
1b72abb2b4
59 files changed
+3595
-976
No files matched your search
@@ -33,18 +33,15 @@ public abstract class Expression implements IPartialExpression {
|
||||
public Expression cast(ZenPosition position, IEnvironmentGlobal environment, ZenType type) {
|
||||
if (getType() == type) {
|
||||
return this;
|
||||
} else if (getType().canCastImplicit(type, environment)) {
|
||||
return new ExpressionAs(position, this, type);
|
||||
} else {
|
||||
environment.error(position, "Cannot cast " + getType() + " to " + type);
|
||||
return new ExpressionInvalid(position, type);
|
||||
return getType().cast(position, environment, this, type);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void compile(boolean result, IEnvironmentMethod environment);
|
||||
|
||||
public void compileIf(Label onElse, IEnvironmentMethod environment) {
|
||||
if (getType() == ZenTypeBool.INSTANCE) {
|
||||
if (getType() == ZenType.BOOL) {
|
||||
compile(true, environment);
|
||||
environment.getOutput().ifEQ(onElse);
|
||||
} else if (getType().isPointer()) {
|
||||
|
||||
Reference in new issue
Block a user