Question
Raku Actions Predicated on Parse Success?
Is there a way to configure Raku actions to only execute after a parse has completed successfully? For example, the program below outputs "Jane is telling us her age....", even with malformed input.
grammar Foo {
rule TOP { <name> is \d+ }
token name { [Anne | Jane] { say "$/ is telling us her age...."; } }
}
say so Foo.parse('Anne is 100'); # True
say so Foo.parse('Jane is Leaf'); # False
4 101
4