Skip to content

rep overrides commit #6067

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

Closed
scabug opened this issue Jul 12, 2012 · 3 comments
Closed

rep overrides commit #6067

scabug opened this issue Jul 12, 2012 · 3 comments

Comments

@scabug
Copy link

scabug commented Jul 12, 2012

The rep parser combinator makes the commit parser combinator ineffective, for example this should not parse but does:

import scala.util.parsing.combinator._
object Test extends RegexParsers {
def test = parseAll(rep(commit("a")) ~ "b", "aaab")
}

I believe the problem is Parsers.scala 649-652

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

should be:

  @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)
  }
@scabug
Copy link
Author

scabug commented Jul 12, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6067?orig=1
Reporter: George Fraser (george.w.fraser)
Affected Versions: 2.9.0

@scabug
Copy link
Author

scabug commented Aug 4, 2012

@adriaanm said:
contributions welcome on github -- unfortunately we don't have the resources to address this right now

@scabug scabug closed this as completed Jul 17, 2015
@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The parser combinators library is now community-maintained. Issues with it are now tracked at scala/scala-parser-combinators#61 instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

Philippus added a commit to Philippus/scala-parser-combinators that referenced this issue Jun 27, 2018
SethTisue added a commit to scala/scala-parser-combinators that referenced this issue Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant