Skip to content

Commit 393c172

Browse files
author
Chris White
committed
Added <?:ifndef?>
1 parent 193cffa commit 393c172

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

perlpp.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ sub ExecuteCommand {
222222
die "Invalid name \"$nm\" in \"ifdef\"" if $nm !~ DEFINE_NAME_RE;
223223
print "if(defined(\$D\{$nm\})) {\n"; # Don't need exists()
224224

225+
} elsif ( $cmd =~ /^ifndef\s++(?<nm>\S++)\s*+$/i ) { # test in %D
226+
my $nm = $+{nm}; # Otherwise !~ clobbers it.
227+
die "Invalid name \"$nm\" in \"ifdef\"" if $nm !~ DEFINE_NAME_RE;
228+
print "if(!defined(\$D\{$nm\})) {\n"; # Don't need exists()
229+
225230
} elsif ( $cmd =~ /^if\s++(.*+)$/i ) { # :if - General test of %D values
226231
my $test = $1; # $1 =~ doesn't work for me
227232
if( $test !~ DEFINE_NAME_IN_CONTEXT_RE ) {

0 commit comments

Comments
 (0)