our @EXPORT = qw(
perl_scalar_value perl_operator Literal Identifier compose intersperse
+ scan_dq_nodes
);
sub intersperse { my $i = shift; my @i = map +($_, $i), @_; pop @i; @i }
$a;
}
+sub scan_dq_nodes {
+ my ($cb_map, @queue) = @_;
+ while (my $node = shift @queue) {
+ if ($node->{type} and my $cb = $cb_map->{$node->{type}}) {
+ $cb->($node);
+ }
+ push @queue,
+ grep ref($_) eq 'HASH',
+ map +(ref($_) eq 'ARRAY' ? @$_ : $_),
+ @{$node}{grep !/\./, keys %$node};
+ }
+}
1;