diff options
author | Yves Orton <demerphq@gmail.com> | 2006-05-28 18:24:59 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-29 12:38:09 +0000 |
commit | 3dab1dad3c281a8a3802c3e053703d7cabca032a (patch) | |
tree | 9a20f0a4eea8eb9ed9e41c8633d91396a4399d62 /ext/re/re.pm | |
parent | b4244ddc1fb37466a15a6ac6569133e40413ca6f (diff) | |
download | perl-3dab1dad3c281a8a3802c3e053703d7cabca032a.tar.gz |
Re: [PATCH] More regex optimisations and debug enhancements (including Andys stuff too)
Message-ID: <9b18b3110605280724u54a9c53bn3b20692b6fe4f1c3@mail.gmail.com>
p4raw-id: //depot/perl@28325
Diffstat (limited to 'ext/re/re.pm')
-rw-r--r-- | ext/re/re.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/re/re.pm b/ext/re/re.pm index fc78451274..2da3a25dbd 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -83,13 +83,15 @@ statements and saying C<< use re Debug => 'EXECUTE' >> will turn it on. Note that these flags can be set directly via ${^RE_DEBUG_FLAGS} by using the following flag values: - RE_DEBUG_COMPILE 1 - RE_DEBUG_EXECUTE 2 - RE_DEBUG_TRIE_COMPILE 4 - RE_DEBUG_TRIE_EXECUTE 8 - RE_DEBUG_TRIE_MORE 16 - RE_DEBUG_OPTIMISE 32 - RE_DEBUG_OFFSETS 64 + + RE_DEBUG_COMPILE 0x01 + RE_DEBUG_EXECUTE 0x02 + RE_DEBUG_TRIE_COMPILE 0x04 + RE_DEBUG_TRIE_EXECUTE 0x08 + RE_DEBUG_TRIE_MORE 0x10 + RE_DEBUG_OPTIMISE 0x20 + RE_DEBUG_OFFSETS 0x40 + RE_DEBUG_PARSE 0x80 The directive C<use re 'debug'> and its equivalents are I<not> lexically scoped, as the other directives are. They have both compile-time and run-time @@ -129,7 +131,8 @@ my %flags = ( OPTIMISE => 32, OPTIMIZE => 32, # alias OFFSETS => 64, - ALL => 127, + PARSE => 128, + ALL => 255, All => 15, More => 31, ); @@ -159,6 +162,8 @@ sub bits { if ($flags{$_[$idx]}) { if ($on) { ${^RE_DEBUG_FLAGS} |= $flags{$_[$idx]}; + ${^RE_DEBUG_FLAGS} |= 1 + if $flags{$_[$idx]}>2; } else { ${^RE_DEBUG_FLAGS} &= ~ $flags{$_[$idx]}; } |