java-commons/muscript/src/main/java/io/gitlab/jfronny/muscript/ast/BoolExpr.java

25 lines
634 B
Java
Raw Normal View History

2023-01-20 18:52:57 +01:00
package io.gitlab.jfronny.muscript.ast;
2023-01-20 18:52:57 +01:00
import io.gitlab.jfronny.muscript.ast.dynamic.DynamicCoerce;
import io.gitlab.jfronny.muscript.compiler.Order;
2022-11-24 19:05:51 +01:00
import io.gitlab.jfronny.muscript.compiler.Type;
public abstract non-sealed class BoolExpr extends Expr<Boolean> {
protected BoolExpr(Order order, int chStart, int chEnd) {
super(order, chStart, chEnd);
2022-06-13 13:31:54 +02:00
}
@Override
public Type getResultType() {
return Type.Boolean;
}
@Override
public abstract BoolExpr optimize();
@Override
public DynamicExpr asDynamicExpr() {
2023-01-20 17:47:41 +01:00
return new DynamicCoerce(chStart, chEnd, this);
}
}