Skip to content

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

Closed
@scabug

Description

@scabug

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions