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

25 lines
638 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 NumberExpr extends Expr<Double> {
protected NumberExpr(Order order, int chStart, int chEnd) {
super(order, chStart, chEnd);
2022-06-13 13:31:54 +02:00
}
@Override
public Type getResultType() {
return Type.Number;
}
@Override
public abstract NumberExpr optimize();
@Override
public DynamicExpr asDynamicExpr() {
2023-01-20 17:47:41 +01:00
return new DynamicCoerce(chStart, chEnd, this);
}
}