convered maximal to use character lookahead
[sbp.git] / src / edu / berkeley / sbp / Walk.java
index abbffd7..8b6eae6 100644 (file)
@@ -164,8 +164,10 @@ abstract class Walk<T> {
                 if (matched) walk(a);
             }
 
-            if (e instanceof Repeat.MaximalSequence || e instanceof Repeat.Maximal)
-                cs.remove(new Last<Tok>(cs.fresh(), c).walk(e));
+            if (e instanceof Sequence) {
+                Sequence s = (Sequence)e;
+                if (s.noFollow() != null) cs.remove(s.noFollow().dup());
+            }
 
             if (c != null && e==me) {
                 c.follow.put(e, cs.dup());