Skip to content

Commit

Permalink
+ .gitignore, some dzil tinkering
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Simões committed Aug 15, 2011
1 parent e9bfd8e commit d091310
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .gitignore
@@ -0,0 +1,17 @@
/Want-Boolean*
.build
*.swp
*.bak
*~
*.old
Makefile
blib/
pm_to_blib
Build
_build
cover_db/
nytprof*
*.patch
.DS_Store
MYMETA.*
*.o
1 change: 1 addition & 0 deletions dist.ini
Expand Up @@ -29,6 +29,7 @@ copyright_year = 2011
[ExtraTests]

[Test::PodSpelling]
stopwords = Simões

[PruneFiles]
filenames = dist.ini
Expand Down
10 changes: 7 additions & 3 deletions lib/Want/Boolean.pm
Expand Up @@ -16,6 +16,7 @@ use Sub::Exporter -setup => {

sub wantbool {
my ( $found_op, $start_op );

my $walk_callback = sub {
my $op = shift;
if ( _check_wanted($op) ) {
Expand All @@ -28,7 +29,8 @@ sub wantbool {
}
}
};
# Set starting op and look for opportunities to return early:

# Set starting op and look for opportunities to return early:
my $return_op = return_op(1);
my $parent_op = parent_op(1);
if ( $return_op->flagspv eq 'WANT_VOID' ) {
Expand All @@ -38,7 +40,9 @@ sub wantbool {
$start_op = $return_op;
$found_op = 'not' if $start_op->name eq 'not';
}
walkoptree_simple($start_op, $walk_callback) if !$found_op;

# Find and return the LOGOP, or return undef:
walkoptree_simple($start_op, $walk_callback) if !$found_op;
$found_op = uc $found_op if $found_op;
return $found_op;
}
Expand All @@ -51,4 +55,4 @@ sub _check_wanted {

1;

# ABSTRACT: Determine a sub's calling operator when called in a boolean context
# ABSTRACT: Determine a sub's calling boolean operator

0 comments on commit d091310

Please sign in to comment.