#rule xxx :P5 {.*} #rule _word :P5 {^([_[:alnum:]]+)} macro statement_control: ( $a ) is parsed ( / ? \( ? $a := (.*?) ? \) ? \; / ) { return '$a' ; } macro statement_control: () is parsed ( / ? \( ? $a := (.*?) ? \+ ? $b := (.*?) ? \) ? \; / ) { return ' $a infix:<+> $b ; say \'ok\'; ' ; } '1' infix:<+> '1'; '1' infix:<*> '1'; '1' infix:<+> '1' infix:<*> '1'; '1' infix:<*> '1' infix:<+> '1'; statement_control: ( 2 + 4 ); statement_control: ( say 'something'; ); statement_control: ( '1' ) { say ' is ok!'; } statement_control: ( '0' ) { say ' is not ok :('; } my $a; print 'hello, '; say 'world!'; { say 'in block'; } warn 'hi'; ...;