diff options
author | Simon Cozens <simon@netthink.co.uk> | 2001-08-25 18:45:09 +0100 |
---|---|---|
committer | Artur Bergman <sky@nanisky.com> | 2001-08-27 13:18:45 +0000 |
commit | 53e06cf030da5eb71c0b61c0690494f3c70e0555 (patch) | |
tree | 304c53c9149e75adb4d834be77c98e238221b8b5 /opcode.pl | |
parent | 13137afc7675869b45e226f8338b8d593c7bf6c8 (diff) | |
download | perl-53e06cf030da5eb71c0b61c0690494f3c70e0555.tar.gz |
Custom Ops
Message-ID: <20010825174509.A5752@netthink.co.uk>
I also added a fix to Opcode.pm to quite test cases.
p4raw-id: //depot/perl@11756
Diffstat (limited to 'opcode.pl')
-rwxr-xr-x | opcode.pl | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -65,6 +65,16 @@ print <<END; START_EXTERN_C +#ifdef PERL_CUSTOM_OPS +#define OP_NAME(o) (o->op_type == OP_CUSTOM ? custom_op_name(o) : \\ + PL_op_name[o->op_type]) +#define OP_DESC(o) (o->op_type == OP_CUSTOM ? custom_op_desc(o) : \\ + PL_op_desc[o->op_type]) +#else +#define OP_NAME(o) PL_op_name[o->op_type] +#define OP_DESC(o) PL_op_desc[o->op_type] +#endif + #ifndef DOINIT EXT char *PL_op_name[]; #else @@ -130,7 +140,7 @@ EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = { END for (@ops) { - print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n"; + print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n" unless $_ eq "custom"; } print <<END; @@ -209,7 +219,6 @@ for (@ops) { $argsum |= 32 if $flags =~ /I/; # has corresponding int op $argsum |= 64 if $flags =~ /d/; # danger, unknown side effects $argsum |= 128 if $flags =~ /u/; # defaults to $_ - $flags =~ /([\W\d_])/ or die qq[Opcode "$_" has no class indicator]; $argsum |= $opclass{$1} << 9; $mul = 0x2000; # 2 ^ OASHIFT @@ -291,6 +300,7 @@ print PP "\n\n"; for (@ops) { next if /^i_(pre|post)(inc|dec)$/; + next if /^custom$/; print PP "PERL_PPDEF(Perl_pp_$_)\n"; print PPSYM "Perl_pp_$_\n"; } @@ -887,3 +897,5 @@ threadsv per-thread value ck_null ds0 # Control (contd.) setstate set statement info ck_null s; method_named method with known name ck_null d$ + +custom unknown custom operator ck_null 0 |