# !something
/\G!/gc and
- return do {
- my $match = $self->_parse_spec_section($_);
- return sub {
- return {} unless my @discard = $match->(@_);
- return;
- };
- };
+ return match_not($self->_parse_spec_section($_));
# ?<param spec>
/\G\?/gc and
use base qw(Exporter);
our @EXPORT = qw(
- match_and match_or match_method match_path match_path_strip
+ match_and match_or match_not match_method match_path match_path_strip
match_extension
);
}
}
+sub match_not {
+ my ($match) = @_;
+ sub {
+ if (my @discard = $match->($_[0])) {
+ ();
+ } else {
+ ({});
+ }
+ }
+}
+
sub match_method {
my ($method) = @_;
sub {