summaryrefslogtreecommitdiff
path: root/regcomp.pl
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2007-06-30 01:38:07 +0200
committerYves Orton <demerphq@gmail.com>2007-06-30 15:37:41 +0000
commitf7819f85d6af0dcf9114284a4fe5ef21855e4e5a (patch)
tree0f20f81b6e703acd015e53b4400a73956f2cf7a4 /regcomp.pl
parentc4a7531db1b7667c9d43fd3494f5bbf4901ff149 (diff)
downloadperl-f7819f85d6af0dcf9114284a4fe5ef21855e4e5a.tar.gz
/p vs (?p)
Date: Fri, 29 Jun 2007 23:38:07 +0200 Message-ID: <20070629213807.GA14454@abigail.nl> Subject: [PATCH pod/perlre.pod] Keeping up with the changes. From: Abigail <abigail@abigail.be> Date: Sat, 30 Jun 2007 01:24:36 +0200 Message-ID: <20070629232436.GA15326@abigail.nl> Plus tweaks, and debug enahancements. p4raw-id: //depot/perl@31506
Diffstat (limited to 'regcomp.pl')
-rw-r--r--regcomp.pl31
1 files changed, 30 insertions, 1 deletions
diff --git a/regcomp.pl b/regcomp.pl
index 3ba699b0b6..17472cc811 100644
--- a/regcomp.pl
+++ b/regcomp.pl
@@ -187,9 +187,38 @@ print OUT <<EOP;
};
#endif /* DOINIT */
-/* ex: set ro: */
+/* PL_reg_extflags_name[] - Opcode/state names in string form, for debugging */
+
+#ifndef DOINIT
+EXTCONST char * PL_reg_extflags_name[];
+#else
+EXTCONST char * const PL_reg_extflags_name[] = {
EOP
+open my $fh,"<","regexp.h" or die "Can't read regexp.h: $!";
+my %rxfv;
+my $val;
+while (<$fh>) {
+ if (/#define\s+(RXf_\w+)\s+(0x[A-F\d]+)/i) {
+ $rxfv{$1}= eval $2;
+ $val|=$rxfv{$1};
+ }
+}
+my %vrxf=reverse %rxfv;
+printf OUT "\t/* Bits in extflags defined: %032b */\n",$val;
+for (0..31) {
+ my $n=$vrxf{2**$_}||"UNUSED_BIT_$_";
+ $n=~s/^RXf_(PMf_)?//;
+ printf OUT qq(\t%-20s/* 0x%08x */\n),
+ qq("$n",),2**$_;
+}
+
+print OUT <<EOP;
+};
+#endif /* DOINIT */
+
+/* ex: set ro: */
+EOP
close OUT or die "close $tmp_h: $!";
safer_rename $tmp_h, 'regnodes.h';