Next | Higher-Order Parsing | 40 |
Or "do what A does, but transform its result value somehow":
sub transform { my ($A, $transform) = @_; my $parser = sub { my $in = shift; my ($res, $out) = $A->($in) or return; return ($transform->($res), $out); }; }
Next | Copyright © 2007 M. J. Dominus |