Hi, I have newbie question about parboiled2.
Having following simple case class and rule definitions:
case class Expr(value: Char)
def Expression = rule { optional(ch('+') | ch('*') ~> (Expr(_: Char))) }
I'm getting following error whenever I try to use `optional`, `zeroOrMore`, `oneOrMore` and `times` combinators with Parser Action to create case class (part of AST):
[error] The `optional`, `zeroOrMore`, `oneOrMore` and `times` modifiers can only be used on rules of type `Rule0`, `Rule1[T]` and `Rule[I, O <: I]`!
[error] def Expression = rule { optional(ch('+') | ch('*') ~> ((c: Char) => Expr(c))) }
I tried to move optional up in the rule tree or explicitly specify type parameters for Rule type with Shapeless HList (like Rule[Char :: HNil, Expr :: HNil]), but got the same result.
Could someone please help with this problem?
Thanks,
Vladimir