nqp@parrot
grammar G { token TOP{ <a>+ }; token a{ <b>|<c> }; token b{ "x" }; token c{ \d } };
class C { method a($/){ say("ohh") if $<b> } };
say(G.parse("x123", :actions(C.new)))
ohh
x123
on MoarVM:
grammar G { token TOP{ <a>+ }; token a{ <b>|<c> }; token b{ "x" }; token c{ \d } };
class C { method a($/){ say("ohh") if $<b> } };
say(G.parse("x123", :actions(C.new)))
ohh
ohh
ohh
ohh
x123
fixed