2023-01-20 18:52:57 +01:00
|
|
|
package io.gitlab.jfronny.muscript.data.dynamic;
|
2022-06-07 12:19:58 +02:00
|
|
|
|
2023-04-18 14:07:28 +02:00
|
|
|
import io.gitlab.jfronny.muscript.ast.NullLiteral;
|
|
|
|
import io.gitlab.jfronny.muscript.compiler.CodeLocation;
|
2023-09-30 11:59:44 +02:00
|
|
|
import io.gitlab.jfronny.muscript.data.dynamic.type.DType;
|
|
|
|
import io.gitlab.jfronny.muscript.data.dynamic.type.DTypePrimitive;
|
2023-03-12 15:28:44 +01:00
|
|
|
|
2023-08-14 16:55:49 +02:00
|
|
|
public final class DNull implements Dynamic {
|
2022-06-07 12:19:58 +02:00
|
|
|
@Override
|
|
|
|
public Object getValue() {
|
|
|
|
return null;
|
|
|
|
}
|
2023-03-12 15:28:44 +01:00
|
|
|
|
|
|
|
@Override
|
2023-04-18 14:07:28 +02:00
|
|
|
public NullLiteral toExpr() {
|
|
|
|
return new NullLiteral(CodeLocation.NONE);
|
2023-03-12 15:28:44 +01:00
|
|
|
}
|
|
|
|
|
2023-09-30 11:59:44 +02:00
|
|
|
@Override
|
|
|
|
public DType getSignature() {
|
|
|
|
return DTypePrimitive.NULL;
|
|
|
|
}
|
|
|
|
|
2023-03-12 15:28:44 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "null";
|
|
|
|
}
|
2022-06-07 12:19:58 +02:00
|
|
|
}
|