Files
fabric-carpet/src/main/java/carpet/script/LazyValue.java
T
2019-05-16 14:11:39 -03:00

25 lines
660 B
Java

package carpet.script;
import carpet.script.value.Value;
/** LazyNumber interface created for lazily evaluated functions */
@FunctionalInterface
public interface LazyValue
{
LazyValue FALSE = (c, t) -> Value.FALSE;
LazyValue TRUE = (c, t) -> Value.TRUE;
LazyValue NULL = (c, t) -> Value.NULL;
LazyValue ZERO = (c, t) -> Value.ZERO;
/**
* The Value representation of the left parenthesis, used for parsing
* varying numbers of function parameters.
*/
LazyValue PARAMS_START = (c, t) -> null;
Value evalValue(Context c, Integer type);
default Value evalValue(Context c){
return evalValue(c, 0);
}
}