Skip to content

Commit

Permalink
[nrx] Simplify xact/backtrack correspondence
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 31, 2010
1 parent a2ee189 commit 8f9cfd5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/Cursor.cs
Expand Up @@ -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<State> bt;

Expand All @@ -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 {
Expand All @@ -80,10 +80,6 @@ public struct State {
public void PushBacktrack(string name, int ip) {
bt.obj.ip = ip;
bt = new PSN<State>(bt.obj, bt);
PushMark(name);
}

public void PushMark(string name) {
bt.obj.xact = new XAct(name, bt.obj.xact);
}

Expand Down

0 comments on commit 8f9cfd5

Please sign in to comment.