Closed
Description
Like the description says... it throws a java.lang.StringIndexOutOfBoundsException: String index out of range: -1
because it assumes that the last character is not a newline. Here's a small test program demonstrating the bug:
object Bug extends scala.util.parsing.combinator.RegexParsers {
override def skipWhitespace = false
val whitespace: Parser[String] = "\\s+".r
val anything = elem('a')
val line = log(whitespace <~ anything)("line")
def main(args: Array[String]): Unit = {
println(parse(line, "\n"))
}
}
Metadata
Metadata
Assignees
Labels
No labels