From 8f9cfd5cc9d20064b6a59587343322ebbc9830da Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Tue, 31 Aug 2010 11:21:31 -0700 Subject: [PATCH] [nrx] Simplify xact/backtrack correspondence --- lib/Cursor.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Cursor.cs b/lib/Cursor.cs index 7f9719d1..1f68a464 100644 --- a/lib/Cursor.cs +++ b/lib/Cursor.cs @@ -47,7 +47,7 @@ public struct State { public XAct xact; } - // invariant: xact of top state is NEVER committed + // invariant: xact of top state is NEVER committed/pruned public PSN bt; @@ -68,7 +68,7 @@ public struct State { public Frame Backtrack(Frame th) { do { bt = bt.next; - } while (bt != null && bt.obj.xact.committed); + } while (bt != null && (bt.obj.xact.committed || bt.obj.ip < 0)); if (bt == null) { return th.caller; } else { @@ -80,10 +80,6 @@ public struct State { public void PushBacktrack(string name, int ip) { bt.obj.ip = ip; bt = new PSN(bt.obj, bt); - PushMark(name); - } - - public void PushMark(string name) { bt.obj.xact = new XAct(name, bt.obj.xact); }