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