Implement compound operator patching.

This commit is contained in:
2022-11-14 16:03:35 +08:00
parent 1f57c299a2
commit d5d6465806
2 changed files with 15 additions and 3 deletions

View File

@@ -51,9 +51,8 @@ namespace Cryville.Common.Pdt {
}
public class PushVariable : PdtInstruction {
public int Name { get; private set; }
public PushVariable(string name) {
Name = IdentifierManager.SharedInstance.Request(name);
}
public PushVariable(int name) { Name = name; }
public PushVariable(string name) : this(IdentifierManager.SharedInstance.Request(name)) { }
internal override void Execute(PdtEvaluatorBase etor) {
etor.PushVariable(Name);
}
@@ -63,6 +62,9 @@ namespace Cryville.Common.Pdt {
}
public class Operate : PdtInstruction {
public PdtOperatorSignature Signature { get; private set; }
public Operate(int name, int paramCount) {
Signature = new PdtOperatorSignature(name, paramCount);
}
public Operate(string name, int paramCount) {
Signature = new PdtOperatorSignature(name, paramCount);
}