method numeric($/) { make +$/ } # ^ convert to a number # propagate the number as the AST: method lhs($/) { make $.ast } method rhs($/) { make $.ast } method expression($/) { my $value = $.ast; # iterate over all matches of the first (...) group for $0.list -> $m { $value = %actions{$m.ast}.($value, $m.ast); } make $value; }