Commits

pchiusano  committed 6c63aa8

fixed loop in commit

  • Participants
  • Parent commits 736ebd6
  • Branches error-reporting

Comments (0)

Files changed (1)

File src/main/scala/nomo/Parser.scala

           case Done(t,rem,ann) => t flatMap (s => 
             g(Result(s, ann.get, ann.getUser)) match {
               case Status(c,Right(pb)) => 
+                // (if (false) (pb.commitOnEnter) else pb).feedAll(rem,ann)
                 (if (c) (pb.commitOnEnter) else pb).feedAll(rem,ann)
               case s => suspendS { 
                 (Done(s.asInstanceOf[Status[E,B]],rem,ann), a2) } 
 
   /** Converts any failing parses sequenced after `p` to errors. 
     * Note that if `p` fails, this is considered before the commit point. */
-  def commit[A](p: Parser[A]): Parser[A] = p << unit(()).commit
+  def commit[A](p: Parser[A]): Parser[A] = p << unit(()).commitOnEnter
 
   case class Cont[A](
       f: (Input[F,I], Accumulator[I,X,U]) => Trampoline[(Parser[A], Accumulator[I,X,U])]) extends Parser[A] {