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

Closed
freewind opened this Issue Jul 18, 2011 · 2 comments

Comments

Projects
None yet
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

This comment has been minimized.

Show comment Hide comment
@freewind

freewind Jul 18, 2011

It happens only the times is 1

It happens only the times is 1

@sirthias

This comment has been minimized.

Show comment Hide comment
@sirthias

sirthias Jul 19, 2011

Owner

Thanks for the report!

Owner

sirthias commented Jul 19, 2011

Thanks for the report!

@sirthias sirthias closed this in 62e71d8 Jul 19, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment