Open inkytonik opened 4 years ago
(Reported by Nicholas Weston.)
The parser p defined as follows doesn’t successfully parse ab.
lazy val p: PackratParser[Any] = q | "a" lazy val q: PackratParser[Any] = p ~ "b"
The parse result is
Failure(end of input expected,Input(StringSource(ab,),1))
It works if q is a regular Parser. It also works if p is directly recursive as follows.
lazy val p: PackratParser[Any] = p ~ "b" | "a"
It also happens in 2.3.0-SNAPSHOT but not when using the standard Scala parser combinator library.
See attached project.
parsing-bug.zip
(Reported by Nicholas Weston.)
The parser p defined as follows doesn’t successfully parse ab.
The parse result is
It works if q is a regular Parser. It also works if p is directly recursive as follows.
It also happens in 2.3.0-SNAPSHOT but not when using the standard Scala parser combinator library.
See attached project.