// Dictionary<string, Instruction> strictInstructions // = new Dictionary<string, Instruction>(); public ReorderInterpreter() { // XXX This weird data piping is because an Instruction doesn't and probably shouldn't know its own name. this.instructionFactory = StrictInstruction.factory .Compose(i => { di = new DeferInstruction(null, i); return((TypedInstruction)di); }) .Compose(i => new ReorderWrapper(null, i)); isStrict = false; // Let this be lazy, why don't cha? LoadInstructions(); }
public override void AddInstruction(string name, Instruction i) { // if (i is DeferInstruction di) // di.name = name; // if (name == "!") { // var instructionFactory = StrictInstruction.factory // // .Compose(i => { // // di = new DeferInstruction(null, i); // // return (TypedInstruction) di; // // }) // .Compose(i => new ReorderWrapper(null, i)) // .; // } base.AddInstruction(name, i); if (di != null) { di.name = name; } di = null; }