Make PdtExpression.Empty public.
This commit is contained in:
@@ -7,6 +7,18 @@ namespace Cryville.Common.Pdt {
|
|||||||
/// PDT expression.
|
/// PDT expression.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PdtExpression {
|
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;
|
internal LinkedList<PdtInstruction> Instructions;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the value of this expression is constant.
|
/// Whether the value of this expression is constant.
|
||||||
@@ -125,15 +137,6 @@ namespace Cryville.Common.Pdt {
|
|||||||
{ '$', -1 },
|
{ '$', -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() {
|
PdtExpToken GetToken() {
|
||||||
ws();
|
ws();
|
||||||
var result = new PdtExpToken {
|
var result = new PdtExpToken {
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
break;
|
break;
|
||||||
case ':':
|
case ':':
|
||||||
case ';':
|
case ';':
|
||||||
var exp = c == ';' ? _emptyexp : GetExp();
|
var exp = c == ';' ? PdtExpression.Empty : GetExp();
|
||||||
InterpretObjectInternal<PropertyListAttribute>(pcflag, type, pkey, result, type => _binder.ChangeType(exp, type, null));
|
InterpretObjectInternal<PropertyListAttribute>(pcflag, type, pkey, result, type => _binder.ChangeType(exp, type, null));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user