I'm trying to try out this example from parboiled2:
scala> class MyParser(val input: org.parboiled2.ParserInput)
extends org.parboiled2.Parser {
def f = rule { capture("foo" ~ push(42))
}
}
defined class MyParser
Then, I create a new MyParser
with input of "foo"
.
scala> new MyParser("foo").f
res11: org.parboiled2.Rule[shapeless.HNil,shapeless.::
[Int,shapeless.::[String,shapeless.HNil]]] = null
Yet the return value is null
.
How can I run this simple f
Rule from the REPL?