Make PdtExpression.Empty
public.
This commit is contained in:
@@ -7,6 +7,18 @@ namespace Cryville.Common.Pdt {
|
||||
/// PDT expression.
|
||||
/// </summary>
|
||||
public class PdtExpression {
|
||||
/// <summary>
|
||||
/// The empty expression.
|
||||
/// </summary>
|
||||
public static readonly PdtExpression Empty;
|
||||
static PdtExpression() {
|
||||
var ins = new LinkedList<PdtInstruction>();
|
||||
ins.AddLast(new PdtInstruction.PushConstant(
|
||||
PdtInternalType.Number, BitConverter.GetBytes(1f)
|
||||
));
|
||||
Empty = new PdtExpression(ins);
|
||||
}
|
||||
|
||||
internal LinkedList<PdtInstruction> Instructions;
|
||||
/// <summary>
|
||||
/// Whether the value of this expression is constant.
|
||||
@@ -125,15 +137,6 @@ namespace Cryville.Common.Pdt {
|
||||
{ '$', -1 },
|
||||
};
|
||||
|
||||
static readonly PdtExpression _emptyexp;
|
||||
static PdtInterpreter() {
|
||||
var ins = new LinkedList<PdtInstruction>();
|
||||
ins.AddLast(new PdtInstruction.PushConstant(
|
||||
PdtInternalType.Number, BitConverter.GetBytes(1f)
|
||||
));
|
||||
_emptyexp = new PdtExpression(ins);
|
||||
}
|
||||
|
||||
PdtExpToken GetToken() {
|
||||
ws();
|
||||
var result = new PdtExpToken {
|
||||
|
Reference in New Issue
Block a user