diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-02 20:18:15 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-02 21:32:33 -0700 |
commit | 6342d5c50ab0a9493ebc0908c3a6ec88d18e183b (patch) | |
tree | caeb2446493b1630b58b4192f7b6809ea1b0ced3 | |
parent | 42b824d2b554088191c83ebebdc0d1598f5a4d9a (diff) | |
download | perl-6342d5c50ab0a9493ebc0908c3a6ec88d18e183b.tar.gz |
Add transr op type
for the upcoming y///r feature. There are not enough flag bits,
hence the extra type.
-rw-r--r-- | embed.h | 1 | ||||
-rw-r--r-- | opcode.h | 7 | ||||
-rw-r--r-- | opnames.h | 3 | ||||
-rw-r--r-- | pp.sym | 1 | ||||
-rw-r--r-- | proto.h | 1 | ||||
-rwxr-xr-x | regen/opcode.pl | 8 |
6 files changed, 18 insertions, 3 deletions
@@ -1433,6 +1433,7 @@ #define pp_time() Perl_pp_time(aTHX) #define pp_tms() Perl_pp_tms(aTHX) #define pp_trans() Perl_pp_trans(aTHX) +#define pp_transr() Perl_pp_transr(aTHX) #define pp_truncate() Perl_pp_truncate(aTHX) #define pp_uc() Perl_pp_uc(aTHX) #define pp_ucfirst() Perl_pp_ucfirst(aTHX) @@ -402,6 +402,7 @@ EXTCONST char* const PL_op_name[] = { "reach", "rkeys", "rvalues", + "transr", }; #endif @@ -778,6 +779,7 @@ EXTCONST char* const PL_op_desc[] = { "each on reference", "keys on reference", "values on reference", + "transliteration (tr///)", }; #endif @@ -834,7 +836,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_qr, Perl_pp_subst, Perl_pp_substcont, - Perl_pp_trans, + Perl_pp_trans, /* Perl_pp_trans */ Perl_pp_sassign, Perl_pp_aassign, Perl_pp_chop, @@ -1168,6 +1170,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_rkeys, /* Perl_pp_reach */ Perl_pp_rkeys, Perl_pp_rkeys, /* Perl_pp_rvalues */ + Perl_pp_trans, /* Perl_pp_transr */ } #endif #ifdef PERL_PPADDR_INITED @@ -1555,6 +1558,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_each, /* reach */ Perl_ck_each, /* rkeys */ Perl_ck_each, /* rvalues */ + Perl_ck_match, /* transr */ } #endif #ifdef PERL_CHECK_INITED @@ -1936,6 +1940,7 @@ EXTCONST U32 PL_opargs[] = { 0x00001b00, /* reach */ 0x00001b08, /* rkeys */ 0x00001b08, /* rvalues */ + 0x00001804, /* transr */ }; #endif @@ -384,10 +384,11 @@ typedef enum opcode { OP_REACH = 366, OP_RKEYS = 367, OP_RVALUES = 368, + OP_TRANSR = 369, OP_max } opcode; -#define MAXO 369 +#define MAXO 370 #define OP_phoney_INPUT_ONLY -1 #define OP_phoney_OUTPUT_ONLY -2 @@ -413,5 +413,6 @@ Perl_pp_once Perl_pp_reach Perl_pp_rkeys Perl_pp_rvalues +Perl_pp_transr # ex: set ro: @@ -3178,6 +3178,7 @@ PERL_CALLCONV OP * Perl_pp_tied(pTHX); PERL_CALLCONV OP * Perl_pp_time(pTHX); PERL_CALLCONV OP * Perl_pp_tms(pTHX); PERL_CALLCONV OP * Perl_pp_trans(pTHX); +PERL_CALLCONV OP * Perl_pp_transr(pTHX); PERL_CALLCONV OP * Perl_pp_truncate(pTHX); PERL_CALLCONV OP * Perl_pp_uc(pTHX); PERL_CALLCONV OP * Perl_pp_ucfirst(pTHX); diff --git a/regen/opcode.pl b/regen/opcode.pl index 9369c2ecef..90c1bc0326 100755 --- a/regen/opcode.pl +++ b/regen/opcode.pl @@ -38,7 +38,8 @@ while (<DATA>) { my ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5); $args = '' unless defined $args; - warn qq[Description "$desc" duplicates $seen{$desc}\n] if $seen{$desc}; + warn qq[Description "$desc" duplicates $seen{$desc}\n] + if $seen{$desc} and $key ne "transr"; die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key}; $seen{$desc} = qq[description of opcode "$key"]; $seen{$key} = qq[opcode "$key"]; @@ -106,6 +107,7 @@ my @raw_alias = ( Perl_pp_rv2av => ['rv2hv'], Perl_pp_akeys => ['avalues'], Perl_pp_rkeys => [qw(rvalues reach)], + Perl_pp_trans => [qw(trans transr)], ); while (my ($func, $names) = splice @raw_alias, 0, 2) { @@ -653,6 +655,7 @@ qr pattern quote (qr//) ck_match s/ subst substitution (s///) ck_match dis/ S substcont substitution iterator ck_null dis| trans transliteration (tr///) ck_match is" S +# transr (the /r version) is further down. # Lvalue operators. # sassign is special-cased for op class @@ -1105,3 +1108,6 @@ custom unknown custom operator ck_null 0 reach each on reference ck_each % S rkeys keys on reference ck_each t% S rvalues values on reference ck_each t% S + +# y///r +transr transliteration (tr///) ck_match is" S |