Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

nTimes(1, "a") will throw ClassCastException #29

Closed
freewind opened this Issue · 2 comments

2 participants

@freewind

It happened in "parboiled-scala"

class MyParser extends Parser {
    def xxx = rule {
        nTimes(1, "a")
    }    
}

object MyParser {
    val parser = new MyParser { override val buildParseTree = true }
    val input = "any"
    val result = TracingParseRunner(parser.xxx).run(input)        
}

It will throw:

Exception in thread "main" java.lang.ClassCastException: org.parboiled.matchers.CharMatcher cannot be cast to org.parboiled.matchers.SequenceMatcher
at org.parboiled.scala.Parser$$anonfun$nTimes$1.apply(Parser.scala:268)
at org.parboiled.scala.Parser$$anonfun$nTimes$1.apply(Parser.scala:268)
at org.parboiled.scala.package$.make(package.scala:121)
at org.parboiled.scala.Parser$class.nTimes(Parser.scala:267)
@freewind

It happens only the times is 1

@sirthias
Owner

Thanks for the report!

@sirthias sirthias closed this issue from a commit
@sirthias scala: fix #29 62e71d8
@sirthias sirthias closed this in 62e71d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.