Scala Programming Language
  1. Scala Programming Language
  2. SI-5108

Regression in Combinator Parsing library: parser generator rep1 doesn't propagate errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.8.0, Scala 2.9.2
    • Fix Version/s: Scala 2.10.0
    • Component/s: Misc Library
    • Labels:
      None

      Description

      The rewrite of rep1 in the Parsers trait in r20573 caused a regression of #SI-1100.

      The inner method of rep1 should probably be changed to:

      @tailrec def applyp(in0: Input): ParseResult[List[T]] = p0(in0) match {
        case Success(x, rest) => elems += x ; applyp(rest)
        case e: Error         => e
        case _                => Success(elems.toList, in0)
      }
      

      Just adding the line with case e: Error

      (Is it ok to create a new issue in such cases, or better to reopen the old one?)

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25881) Fix for combinator regression.

        Propagate Error in repN. I have no time for a test case, I will gladly
        take a contribution. References SI-1100, Closes SI-5108, No review.

        Show
        Commit Message Bot added a comment - (extempore in r25881 ) Fix for combinator regression. Propagate Error in repN. I have no time for a test case, I will gladly take a contribution. References SI-1100 , Closes SI-5108 , No review.
        Hide
        Daniel Sobral added a comment -

        Pull request for test case: https://github.com/scala/scala/pull/108

        Show
        Daniel Sobral added a comment - Pull request for test case: https://github.com/scala/scala/pull/108
        Hide
        Commit Message Bot added a comment -

        (extempore in r25889) Test case for SI-1100/SI-5108.

        Show
        Commit Message Bot added a comment - (extempore in r25889 ) Test case for SI-1100 / SI-5108 .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Maarten van der Zwaart
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development