Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this issue Oct 23, 2011 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 23, 2011

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?)

@scabug
Copy link
Author

scabug commented Oct 23, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5108?orig=1
Reporter: Maarten van der Zwaart (mzwaart)
Affected Versions: 2.8.0, 2.9.2

@scabug
Copy link
Author

scabug commented Oct 23, 2011

Commit Message Bot (anonymous) said:
(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 #1100, Closes #5108, No review.

@scabug scabug closed this as completed Oct 23, 2011
@scabug
Copy link
Author

scabug commented Oct 24, 2011

@dcsobral said:
Pull request for test case: scala/scala#108

@scabug
Copy link
Author

scabug commented Oct 24, 2011

Commit Message Bot (anonymous) said:
(extempore in r25889) Test case for #1100/#5108.

@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants