postdec i_postdec int hex oct abs pow multiply i_multiply
divide i_divide modulo i_modulo add i_add subtract i_subtract
- left_shift right_shift bit_and bit_xor bit_or negate i_negate
- not complement
+ left_shift right_shift bit_and bit_xor bit_or nbit_and
+ nbit_xor nbit_or sbit_and sbit_xor sbit_or negate i_negate not
+ complement ncomplement scomplement
lt i_lt gt i_gt le i_le ge i_ge eq i_eq ne i_ne ncmp i_ncmp
slt sgt sle sge seq sne scmp
FEATURE_IS_ENABLED("switch")) \
)
+#define FEATURE_BITWISE_IS_ENABLED \
+ ( \
+ CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \
+ FEATURE_IS_ENABLED("bitwise") \
+ )
+
#define FEATURE_EVALBYTES_IS_ENABLED \
( \
CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_515 \
SvGETMAGIC(arg);
if (SvAMAGIC(arg) && (tmpsv = amagic_call(arg, &PL_sv_undef, method,
- AMGf_noright | AMGf_unary))) {
+ AMGf_noright | AMGf_unary
+ | (flags & AMGf_numarg))))
+ {
if (flags & AMGf_set) {
SETs(tmpsv);
}
if (SvAMAGIC(left) || SvAMAGIC(right)) {
SV * const tmpsv = amagic_call(left, right, method,
- ((flags & AMGf_assign) && opASSIGN ? AMGf_assign: 0));
+ ((flags & AMGf_assign) && opASSIGN ? AMGf_assign: 0)
+ | (flags & AMGf_numarg));
if (tmpsv) {
if (flags & AMGf_set) {
(void)POPs;
case band_amg:
case bor_amg:
case bxor_amg:
+ case sband_amg:
+ case sbor_amg:
+ case sbxor_amg:
if (assign)
force_scalar = 1;
break;
PUSHs(newSVpvn_flags(AMG_id2name(method + assignshift),
AMG_id2namelen(method + assignshift), SVs_TEMP));
}
+ else if (flags & AMGf_numarg)
+ PUSHs(&PL_sv_undef);
+ if (flags & AMGf_numarg)
+ PUSHs(&PL_sv_yes);
PUSHs(MUTABLE_SV(cv));
PUTBACK;
oldmark = TOPMARK;
MDEREF_SHIFT
);
-$VERSION = '1.32';
+$VERSION = '1.33';
use strict;
use vars qw/$AUTOLOAD/;
use warnings ();
sub pp_i_postinc { maybe_targmy(@_, \&pfixop, "++", 23, POSTFIX) }
sub pp_i_postdec { maybe_targmy(@_, \&pfixop, "--", 23, POSTFIX) }
sub pp_complement { maybe_targmy(@_, \&pfixop, "~", 21) }
+*pp_ncomplement = *pp_complement;
+sub pp_scomplement { maybe_targmy(@_, \&pfixop, "~.", 21) }
sub pp_negate { maybe_targmy(@_, \&real_negate) }
sub real_negate {
'subtract' => 18, 'i_subtract' => 18,
'concat' => 18,
'left_shift' => 17, 'right_shift' => 17,
- 'bit_and' => 13,
+ 'bit_and' => 13, 'nbit_and' => 13, 'sbit_and' => 13,
'bit_or' => 12, 'bit_xor' => 12,
+ 'sbit_or' => 12, 'sbit_xor' => 12,
+ 'nbit_or' => 12, 'nbit_xor' => 12,
'and' => 3,
'or' => 2, 'xor' => 2,
);
'subtract=' => 7, 'i_subtract=' => 7,
'concat=' => 7,
'left_shift=' => 7, 'right_shift=' => 7,
- 'bit_and=' => 7,
- 'bit_or=' => 7, 'bit_xor=' => 7,
+ 'bit_and=' => 7, 'sbit_and=' => 7, 'nbit_and=' => 7,
+ 'nbit_or=' => 7, 'nbit_xor=' => 7,
+ 'sbit_or=' => 7, 'sbit_xor=' => 7,
'andassign' => 7,
'orassign' => 7,
);
sub pp_bit_and { maybe_targmy(@_, \&binop, "&", 13, ASSIGN) }
sub pp_bit_or { maybe_targmy(@_, \&binop, "|", 12, ASSIGN) }
sub pp_bit_xor { maybe_targmy(@_, \&binop, "^", 12, ASSIGN) }
+*pp_nbit_and = *pp_bit_and;
+*pp_nbit_or = *pp_bit_or;
+*pp_nbit_xor = *pp_bit_xor;
+sub pp_sbit_and { maybe_targmy(@_, \&binop, "&.", 13, ASSIGN) }
+sub pp_sbit_or { maybe_targmy(@_, \&binop, "|.", 12, ASSIGN) }
+sub pp_sbit_xor { maybe_targmy(@_, \&binop, "^.", 12, ASSIGN) }
sub pp_eq { binop(@_, "==", 14) }
sub pp_ne { binop(@_, "!=", 14) }
|divide|i_divide|modulo|i_modulo|add|i_add|subtract
|i_subtract|concat|stringify|left_shift|right_shift|lt
|i_lt|gt|i_gt|le|i_le|ge|i_ge|eq|i_eq|ne|i_ne|ncmp|i_ncmp
- |slt|sgt|sle|sge|seq|sne|scmp|bit_and|bit_xor|bit_or
- |negate|i_negate|not|complement|smartmatch|atan2|sin|cos
+ |slt|sgt|sle|sge|seq|sne|scmp|[sn]?bit_(?:and|x?or)|negate
+ |i_negate|not|[sn]?complement|smartmatch|atan2|sin|cos
|rand|srand|exp|log|sqrt|int|hex|oct|abs|length|substr
|vec|index|rindex|sprintf|formline|ord|chr|crypt|ucfirst
|lcfirst|uc|lc|quotemeta|aelemfast|aelem|exists|helem
print f();
>>>>
use feature 'lexical_subs';
-BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x55"}
+BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x55\x01"}
my sub f {
- BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"}
+ BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x01"}
}
-BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"}
+BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x01"}
print f();
####
# SKIP ?$] < 5.017004 && "lexical subs not implemented on this Perl version"
print f();
>>>>
use feature 'lexical_subs';
-BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x55"}
+BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x55\x01"}
CORE::state sub f {
- BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"}
+ BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x01"}
use feature 'state';
}
-BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"}
+BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55\x01"}
use feature 'state';
print f();
####
chdir 'file';
chdir FH;
chdir;
+####
+# 5.22 bitops
+# CONTEXT use feature "bitwise"; no warnings "experimental::bitwise";
+$_ = $_ | $_;
+$_ = $_ & $_;
+$_ = $_ ^ $_;
+$_ = ~$_;
+$_ = $_ |. $_;
+$_ = $_ &. $_;
+$_ = $_ ^. $_;
+$_ = ~.$_;
+$_ |= $_;
+$_ &= $_;
+$_ ^= $_;
+$_ |.= $_;
+$_ &.= $_;
+$_ ^.= $_;
$bits{$_}{6} = 'OPpREFCOUNTED' for qw(leave leaveeval leavesub leavesublv leavewrite);
$bits{$_}{6} = 'OPpRUNTIME' for qw(match pushre qr subst substcont);
$bits{$_}{2} = 'OPpSLICEWARNING' for qw(aslice hslice padav padhv rv2av rv2hv);
-$bits{$_}{4} = 'OPpTARGET_MY' for qw(abs add atan2 chdir chmod chomp chown chr chroot complement concat cos crypt divide exec exp flock getpgrp getppid getpriority hex i_add i_divide i_modulo i_multiply i_ncmp i_subtract index int kill left_shift length link log match mkdir modulo multiply oct ord pow push rand rename repeat right_shift rindex rmdir schomp scmp setpgrp setpriority sin sleep split sqrt srand stringify subst subtract symlink system time trans transr unlink unshift utime vec wait waitpid);
+$bits{$_}{4} = 'OPpTARGET_MY' for qw(abs add atan2 chdir chmod chomp chown chr chroot complement concat cos crypt divide exec exp flock getpgrp getppid getpriority hex i_add i_divide i_modulo i_multiply i_ncmp i_subtract index int kill left_shift length link log match mkdir modulo multiply nbit_and nbit_or nbit_xor ncomplement oct ord pow push rand rename repeat right_shift rindex rmdir schomp scmp scomplement setpgrp setpriority sin sleep split sqrt srand stringify subst subtract symlink system time trans transr unlink unshift utime vec wait waitpid);
$bits{$_}{5} = 'OPpTRANS_COMPLEMENT' for qw(trans transr);
$bits{$_}{7} = 'OPpTRANS_DELETE' for qw(trans transr);
$bits{$_}{0} = 'OPpTRANS_FROM_UTF' for qw(trans transr);
@{$bits{msgsnd}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
@{$bits{multideref}}{5,4,0} = ('OPpMULTIDEREF_DELETE', 'OPpMULTIDEREF_EXISTS', $bf[0]);
@{$bits{multiply}}{1,0} = ($bf[1], $bf[1]);
+@{$bits{nbit_and}}{1,0} = ($bf[1], $bf[1]);
+@{$bits{nbit_or}}{1,0} = ($bf[1], $bf[1]);
+@{$bits{nbit_xor}}{1,0} = ($bf[1], $bf[1]);
@{$bits{ncmp}}{1,0} = ($bf[1], $bf[1]);
+$bits{ncomplement}{0} = $bf[0];
@{$bits{ne}}{1,0} = ($bf[1], $bf[1]);
$bits{negate}{0} = $bf[0];
$bits{next}{0} = $bf[0];
@{$bits{rv2sv}}{5,4,0} = ($bf[6], $bf[6], $bf[0]);
$bits{rvalues}{0} = $bf[0];
@{$bits{sassign}}{7,6,1,0} = ('OPpASSIGN_CV_TO_GV', 'OPpASSIGN_BACKWARDS', $bf[1], $bf[1]);
+@{$bits{sbit_and}}{1,0} = ($bf[1], $bf[1]);
+@{$bits{sbit_or}}{1,0} = ($bf[1], $bf[1]);
+@{$bits{sbit_xor}}{1,0} = ($bf[1], $bf[1]);
$bits{scalar}{0} = $bf[0];
$bits{schomp}{0} = $bf[0];
$bits{schop}{0} = $bf[0];
@{$bits{scmp}}{1,0} = ($bf[1], $bf[1]);
+$bits{scomplement}{0} = $bf[0];
@{$bits{seek}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
@{$bits{seekdir}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
@{$bits{select}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]);
OPpSORT_DESCEND => [qw(sort)],
OPpSPLIT_IMPLIM => [qw(split)],
OPpSUBSTR_REPL_FIRST => [qw(substr)],
- OPpTARGET_MY => [qw(abs add atan2 chdir chmod chomp chown chr chroot complement concat cos crypt divide exec exp flock getpgrp getppid getpriority hex i_add i_divide i_modulo i_multiply i_ncmp i_subtract index int kill left_shift length link log match mkdir modulo multiply oct ord pow push rand rename repeat right_shift rindex rmdir schomp scmp setpgrp setpriority sin sleep split sqrt srand stringify subst subtract symlink system time trans transr unlink unshift utime vec wait waitpid)],
+ OPpTARGET_MY => [qw(abs add atan2 chdir chmod chomp chown chr chroot complement concat cos crypt divide exec exp flock getpgrp getppid getpriority hex i_add i_divide i_modulo i_multiply i_ncmp i_subtract index int kill left_shift length link log match mkdir modulo multiply nbit_and nbit_or nbit_xor ncomplement oct ord pow push rand rename repeat right_shift rindex rmdir schomp scmp scomplement setpgrp setpriority sin sleep split sqrt srand stringify subst subtract symlink system time trans transr unlink unshift utime vec wait waitpid)],
OPpTRANS_COMPLEMENT => [qw(trans transr)],
);
package feature;
-our $VERSION = '1.39';
+our $VERSION = '1.40';
our %feature = (
fc => 'feature_fc',
say => 'feature_say',
state => 'feature_state',
switch => 'feature_switch',
+ bitwise => 'feature_bitwise',
evalbytes => 'feature_evalbytes',
postderef => 'feature_postderef',
array_base => 'feature_arybase',
"5.10" => [qw(array_base say state switch)],
"5.11" => [qw(array_base say state switch unicode_strings)],
"5.15" => [qw(current_sub evalbytes fc say state switch unicode_eval unicode_strings)],
- "all" => [qw(array_base current_sub evalbytes fc lexical_subs postderef postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)],
+ "all" => [qw(array_base bitwise current_sub evalbytes fc lexical_subs postderef postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)],
"default" => [qw(array_base)],
);
This feature is available from Perl 5.22 onwards.
+=head2 The 'bitwise' feature
+
+B<WARNING>: This feature is still experimental and the implementation may
+change in future versions of Perl. For this reason, Perl will
+warn when you use the feature, unless you have explicitly disabled the
+warning:
+
+ no warnings "experimental::bitwise";
+
+This makes the four standard bitwise operators (C<& | ^ ~>) treat their
+operands consistently as numbers, and introduces four new dotted operators
+(C<&. |. ^. ~.>) that treat their operands consistently as strings. The
+same applies to the assignment variants (C<&= |= ^= &.= |.= ^.=>).
+
+See L<perlop/Bitwise String Operators> for details.
+
+This feature is available from Perl 5.22 onwards.
+
=head1 FEATURE BUNDLES
It's possible to load multiple features together, using
package overload;
-our $VERSION = '1.24';
+our $VERSION = '1.25';
%ops = (
with_assign => "+ - * / % ** << >> x .",
num_comparison => "< <= > >= == !=",
'3way_comparison' => "<=> cmp",
str_comparison => "lt le gt ge eq ne",
- binary => '& &= | |= ^ ^=',
- unary => "neg ! ~",
+ binary => '& &= | |= ^ ^= &. &.= |. |.= ^. ^.=',
+ unary => "neg ! ~ ~.",
mutators => '++ --',
func => "atan2 cos sin exp abs log sqrt int",
conversion => 'bool "" 0+ qr',
# * may recurse once - see table below
Three arguments are passed to all subroutines specified in the
-C<use overload> directive (with one exception - see L</nomethod>).
+C<use overload> directive (with exceptions - see below, particularly
+L</nomethod>).
+
The first of these is the operand providing the overloaded
operator implementation -
in this case, the object whose C<minus()> method is being called.
# ...
sub decr { --${$_[0]}; }
+If the experimental "bitwise" feature is enabled (see L<feature>), a fifth
+TRUE argument is passed to subroutines handling C<&>, C<|>, C<^> and C<~>.
+This indicates that the caller is expecting numeric behaviour. The fourth
+argument will be C<undef>, as that position (C<$_[3]>) is reserved for use
+by L</nomethod>.
+
=head3 Mathemagic, Mutators, and Copy Constructors
The term 'mathemagic' describes the overloaded implementation
num_comparison => '< <= > >= == !=',
'3way_comparison'=> '<=> cmp',
str_comparison => 'lt le gt ge eq ne',
- binary => '& &= | |= ^ ^=',
- unary => 'neg ! ~',
+ binary => '& &= | |= ^ ^= &. &.= |. |.= ^. ^.=',
+ unary => 'neg ! ~ ~.',
mutators => '++ --',
func => 'atan2 cos sin exp abs log sqrt int',
conversion => 'bool "" 0+ qr',
=item * I<Assignments>
+= -= *= /= %= **= <<= >>= x= .=
- &= |= ^=
+ &= |= ^= &.= |.= ^.=
Simple assignment is not overloadable (the C<'='> key is used
for the L<Copy Constructor>).
=item * I<Non-mutators with a mutator variant>
+ - * / % ** << >> x .
- & | ^
+ & | ^ &. |. ^.
As described L<above|"Calling Conventions and Magic Autogeneration">,
Perl may call methods for operators like C<+> and C<&> in the course
And other assignment variations are analogous to
C<'+='> and C<'-='> (and similar to C<'.='> and C<'x='> above):
- operator || *= /= %= **= <<= >>= &= ^= |=
- -------------------||--------------------------------
- autogenerated from || * / % ** << >> & ^ |
+ operator || *= /= %= **= <<= >>= &= ^= |= &.= ^.= |.=
+ -------------------||-------------------------------------------
+ autogenerated from || * / % ** << >> & ^ | &. ^. |.
Note also that the copy constructor (key C<'='>) may be
autogenerated, but only for objects based on scalars.
+ - * / % ** << >> x
<=> cmp
- & | ^ ~
+ & | ^ ~ &. |. ^. ~.
atan2 cos sin exp log sqrt int
"" 0+ bool
~~
The first three arguments coincide with those that would have been
passed to the corresponding method if it had been defined.
The fourth argument is the C<use overload> key for that missing
-method.
+method. If the experimental "bitwise" feature is enabled (see L<feature>),
+a fifth TRUE argument is passed to subroutines handling C<&>, C<|>, C<^> and C<~> to indicate that the caller is expecting numeric behaviour.
For example, if C<$a> is an object blessed into a package declaring
Perl.)
If a package uses overload, it carries a special flag. This flag is also
-set when new function are defined or @ISA is modified. There will be a
+set when new functions are defined or @ISA is modified. There will be a
slight speed penalty on the very first operation thereafter that supports
overloading, while the overload tables are updated. If there is no
overloading present, the flag is turned off. Thus the only speed penalty
$| = 1;
BEGIN { require './test.pl' }
-plan tests => 5199;
+plan tests => 5215;
use Scalar::Util qw(tainted);
"1,2,3,1,4,5,6",
'(...)x... in void cx with x overloaded [perl #121827]';
+package bitops {
+ our @o;
+ use overload do {
+ my %o;
+ for my $o (qw(& | ^ ~ &. |. ^. ~. &= |= ^= &.= |.= ^.=)) {
+ $o{$o} = sub {
+ ::ok !defined $_[3], "undef (or nonexistent) arg 3 for $o";
+ push @o, $o, scalar @_, $_[4]//'u';
+ $_[0]
+ }
+ }
+ %o, '=' => sub { bless [] };
+ }
+}
+{
+ use experimental 'bitwise';
+ my $o = bless [], bitops::;
+ $_ = $o & 0;
+ $_ = $o | 0;
+ $_ = $o ^ 0;
+ $_ = ~$o;
+ $_ = $o &. 0;
+ $_ = $o |. 0;
+ $_ = $o ^. 0;
+ $_ = ~.$o;
+ $o &= 0;
+ $o |= 0;
+ $o ^= 0;
+ $o &.= 0;
+ $o |.= 0;
+ $o ^.= 0;
+ # elems are in triplets: op, length of @_, numeric? (1/u for y/n)
+ is "@bitops::o", '& 5 1 | 5 1 ^ 5 1 ~ 5 1 &. 3 u |. 3 u ^. 3 u ~. 3 u ' . '&= 5 1 |= 5 1 ^= 5 1 &.= 3 u |.= 3 u ^.= 3 u',
+ 'experimental "bitwise" ops'
+}
+package bitops2 {
+ our @o;
+ use overload
+ nomethod => sub { push @o, $_[3], scalar @_, $_[4]//'u'; $_[0] },
+ '=' => sub { bless [] };
+}
+{
+ use experimental 'bitwise';
+ my $o = bless [], bitops2::;
+ $_ = $o & 0;
+ $_ = $o | 0;
+ $_ = $o ^ 0;
+ $_ = ~$o;
+ $_ = $o &. 0;
+ $_ = $o |. 0;
+ $_ = $o ^. 0;
+ $_ = ~.$o;
+ $o &= 0;
+ $o |= 0;
+ $o ^= 0;
+ $o &.= 0;
+ $o |.= 0;
+ $o ^.= 0;
+ # elems are in triplets: op, length of @_, numeric? (1/u for y/n)
+ is "@bitops2::o", '& 5 1 | 5 1 ^ 5 1 ~ 5 1 &. 4 u |. 4 u ^. 4 u ~. 4 u ' . '&= 5 1 |= 5 1 ^= 5 1 &.= 4 u |.= 4 u ^.= 4 u',
+ 'experimental "bitwise" ops with nomethod'
+}
+
{ # undefining the overload stash -- KEEP THIS TEST LAST
package ant;
use overload '+' => 'onion';
(>>=
(&
(&=
+ (&.
+ (&.=
(|
(|=
+ (|.
+ (|.=
(^
(^=
+ (^.
+ (^.=
(<=>
(cmp
(~
+ (~.
(atan2
(cos
(sin
rshift_ass
band
band_ass
+ sband
+ sband_ass
bor
bor_ass
+ sbor
+ sbor_ass
bxor
bxor_ass
+ sbxor
+ sbxor_ass
ncmp
scmp
compl
+ scompl
atan2
cos
sin
'syscalls' => 118,
# Warnings Categories added in Perl 5.021
- 'experimental::const_attr' => 120,
- 'experimental::re_strict' => 122,
- 'experimental::refaliasing' => 124,
- 'experimental::win32_perlio' => 126,
- 'locale' => 128,
- 'missing' => 130,
- 'redundant' => 132,
+ 'experimental::bitwise' => 120,
+ 'experimental::const_attr' => 122,
+ 'experimental::re_strict' => 124,
+ 'experimental::refaliasing' => 126,
+ 'experimental::win32_perlio' => 128,
+ 'locale' => 130,
+ 'missing' => 132,
+ 'redundant' => 134,
);
our %Bits = (
- 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15", # [0..66]
+ 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..67]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x15\x55\x00", # [51..58,60..63]
+ 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x15\x55\x01", # [51..58,60..64]
'experimental::autoderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [56]
- 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [60]
+ 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [60]
+ 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [61]
'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [52]
'experimental::lexical_topic' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [53]
'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [57]
- 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [61]
- 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [62]
+ 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [62]
+ 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [63]
'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [54]
'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [58]
'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [55]
- 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [63]
+ 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [64]
'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [47]
'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [46]
'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [5..11,59]
'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
- 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [64]
+ 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [65]
'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
- 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [65]
+ 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [66]
'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [48]
'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [49]
'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [36]
'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
- 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [66]
+ 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [67]
'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [37]
'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [38]
);
our %DeadBits = (
- 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x2a", # [0..66]
+ 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..67]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\x2a\xaa\x00", # [51..58,60..63]
+ 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\x2a\xaa\x02", # [51..58,60..64]
'experimental::autoderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [56]
- 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [60]
+ 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [60]
+ 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [61]
'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [52]
'experimental::lexical_topic' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [53]
'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [57]
- 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [61]
- 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [62]
+ 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [62]
+ 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [63]
'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [54]
'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [58]
'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [55]
- 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [63]
+ 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [64]
'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [47]
'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [46]
'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [5..11,59]
'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
- 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [64]
+ 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [65]
'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
- 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [65]
+ 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [66]
'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [48]
'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [49]
'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [36]
'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
- 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [66]
+ 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [67]
'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [37]
'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [38]
# These are used by various things, including our own tests
our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x15\x55\x01", # [2,56,60,52,53,57,61,62,54,58,55,63,4,64,22,23,25]
-our $LAST_BIT = 134 ;
+our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x15\x55\x05", # [2,56,60,61,52,53,57,62,63,54,58,55,64,4,65,22,23,25]
+our $LAST_BIT = 136 ;
our $BYTES = 17 ;
our $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
| |
| +- experimental::autoderef
| |
+ | +- experimental::bitwise
+ | |
| +- experimental::const_attr
| |
| +- experimental::lexical_subs
PERL_ARGS_ASSERT_CK_BITOP;
o->op_private = (U8)(PL_hints & HINT_INTEGER);
+
+ if (o->op_type == OP_NBIT_OR || o->op_type == OP_SBIT_OR
+ || o->op_type == OP_NBIT_XOR || o->op_type == OP_SBIT_XOR
+ || o->op_type == OP_NBIT_AND || o->op_type == OP_SBIT_AND
+ || o->op_type == OP_NCOMPLEMENT || o->op_type == OP_SCOMPLEMENT)
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_EXPERIMENTAL__BITWISE),
+ "The bitwise feature is experimental");
if (!(o->op_flags & OPf_STACKED) /* Not an assignment */
- && (o->op_type == OP_BIT_OR
- || o->op_type == OP_BIT_AND
- || o->op_type == OP_BIT_XOR))
+ && OP_IS_INFIX_BIT(o->op_type))
{
const OP * const left = cBINOPo->op_first;
const OP * const right = OpSIBLING(left);
(OP_IS_NUMCOMPARE(right->op_type) &&
(right->op_flags & OPf_PARENS) == 0))
Perl_ck_warner(aTHX_ packWARN(WARN_PRECEDENCE),
- "Possible precedence problem on bitwise %c operator",
- o->op_type == OP_BIT_OR ? '|'
- : o->op_type == OP_BIT_AND ? '&' : '^'
+ "Possible precedence problem on bitwise %s operator",
+ o->op_type == OP_BIT_OR
+ ||o->op_type == OP_NBIT_OR ? "|"
+ : o->op_type == OP_BIT_AND
+ ||o->op_type == OP_NBIT_AND ? "&"
+ : o->op_type == OP_BIT_XOR
+ ||o->op_type == OP_NBIT_XOR ? "^"
+ : o->op_type == OP_SBIT_OR ? "|."
+ : o->op_type == OP_SBIT_AND ? "&." : "^."
);
}
return o;
#define Perl_pp_sgt Perl_pp_sle
#define Perl_pp_sge Perl_pp_sle
#define Perl_pp_bit_xor Perl_pp_bit_or
+#define Perl_pp_nbit_xor Perl_pp_nbit_or
+#define Perl_pp_sbit_xor Perl_pp_sbit_or
#define Perl_pp_cos Perl_pp_sin
#define Perl_pp_exp Perl_pp_sin
#define Perl_pp_log Perl_pp_sin
"bit_and",
"bit_xor",
"bit_or",
+ "nbit_and",
+ "nbit_xor",
+ "nbit_or",
+ "sbit_and",
+ "sbit_xor",
+ "sbit_or",
"negate",
"i_negate",
"not",
"complement",
+ "ncomplement",
+ "scomplement",
"smartmatch",
"atan2",
"sin",
"bitwise and (&)",
"bitwise xor (^)",
"bitwise or (|)",
+ "numeric bitiwse and (&)",
+ "numeric bitwise xor (^)",
+ "numeric bitwise or (|)",
+ "string bitiwse and (&)",
+ "string bitwise xor (^)",
+ "string bitwise or (|)",
"negation (-)",
"integer negation (-)",
"not",
"1's complement (~)",
+ "numeric 1's complement (~)",
+ "string 1's complement (~)",
"smart match",
"atan2",
"sin",
Perl_pp_bit_and,
Perl_pp_bit_xor, /* implemented by Perl_pp_bit_or */
Perl_pp_bit_or,
+ Perl_pp_nbit_and,
+ Perl_pp_nbit_xor, /* implemented by Perl_pp_nbit_or */
+ Perl_pp_nbit_or,
+ Perl_pp_sbit_and,
+ Perl_pp_sbit_xor, /* implemented by Perl_pp_sbit_or */
+ Perl_pp_sbit_or,
Perl_pp_negate,
Perl_pp_i_negate,
Perl_pp_not,
Perl_pp_complement,
+ Perl_pp_ncomplement,
+ Perl_pp_scomplement,
Perl_pp_smartmatch,
Perl_pp_atan2,
Perl_pp_sin,
Perl_ck_bitop, /* bit_and */
Perl_ck_bitop, /* bit_xor */
Perl_ck_bitop, /* bit_or */
+ Perl_ck_bitop, /* nbit_and */
+ Perl_ck_bitop, /* nbit_xor */
+ Perl_ck_bitop, /* nbit_or */
+ Perl_ck_bitop, /* sbit_and */
+ Perl_ck_bitop, /* sbit_xor */
+ Perl_ck_bitop, /* sbit_or */
Perl_ck_null, /* negate */
Perl_ck_null, /* i_negate */
Perl_ck_null, /* not */
Perl_ck_bitop, /* complement */
+ Perl_ck_bitop, /* ncomplement */
+ Perl_ck_bitop, /* scomplement */
Perl_ck_smartmatch, /* smartmatch */
Perl_ck_fun, /* atan2 */
Perl_ck_fun, /* sin */
0x0001120e, /* bit_and */
0x0001120e, /* bit_xor */
0x0001120e, /* bit_or */
+ 0x0001121e, /* nbit_and */
+ 0x0001121e, /* nbit_xor */
+ 0x0001121e, /* nbit_or */
+ 0x0001120e, /* sbit_and */
+ 0x0001120e, /* sbit_xor */
+ 0x0001120e, /* sbit_or */
0x0000112e, /* negate */
0x0000110e, /* i_negate */
0x00001106, /* not */
0x0000111e, /* complement */
+ 0x0000111e, /* ncomplement */
+ 0x0000111e, /* scomplement */
0x00000204, /* smartmatch */
0x0001141e, /* atan2 */
0x00009b9e, /* sin */
12, /* bit_and */
12, /* bit_xor */
12, /* bit_or */
+ 74, /* nbit_and */
+ 74, /* nbit_xor */
+ 74, /* nbit_or */
+ 12, /* sbit_and */
+ 12, /* sbit_xor */
+ 12, /* sbit_or */
0, /* negate */
0, /* i_negate */
0, /* not */
72, /* complement */
+ 72, /* ncomplement */
+ 72, /* scomplement */
12, /* smartmatch */
79, /* atan2 */
72, /* sin */
0x03b8, 0x1570, 0x3c8c, 0x3748, 0x2da5, /* const */
0x29dc, 0x2ef9, /* gvsv */
0x13d5, /* gv */
- 0x0067, /* gelem, lt, i_lt, gt, i_gt, le, i_le, ge, i_ge, eq, i_eq, ne, i_ne, ncmp, slt, sgt, sle, sge, seq, sne, bit_and, bit_xor, bit_or, smartmatch, lslice, xor */
+ 0x0067, /* gelem, lt, i_lt, gt, i_gt, le, i_le, ge, i_ge, eq, i_eq, ne, i_ne, ncmp, slt, sgt, sle, sge, seq, sne, bit_and, bit_xor, bit_or, sbit_and, sbit_xor, sbit_or, smartmatch, lslice, xor */
0x29dc, 0x3bd8, 0x0257, /* padsv */
0x29dc, 0x3bd8, 0x2acc, 0x38c9, /* padav */
0x29dc, 0x3bd8, 0x0534, 0x05d0, 0x2acc, 0x38c9, /* padhv */
0x0c9c, 0x1dd8, 0x0834, 0x3ef0, 0x3a0c, 0x2168, 0x01e4, 0x0141, /* trans, transr */
0x0adc, 0x0458, 0x0067, /* sassign */
0x0758, 0x2acc, 0x0067, /* aassign */
- 0x3ef0, 0x0003, /* chomp, schomp, complement, sin, cos, exp, log, sqrt, int, hex, oct, abs, length, ord, chr, chroot, rmdir */
- 0x3ef0, 0x0067, /* pow, multiply, i_multiply, divide, i_divide, modulo, i_modulo, add, i_add, subtract, i_subtract, concat, left_shift, right_shift, i_ncmp, scmp */
+ 0x3ef0, 0x0003, /* chomp, schomp, complement, ncomplement, scomplement, sin, cos, exp, log, sqrt, int, hex, oct, abs, length, ord, chr, chroot, rmdir */
+ 0x3ef0, 0x0067, /* pow, multiply, i_multiply, divide, i_divide, modulo, i_modulo, add, i_add, subtract, i_subtract, concat, left_shift, right_shift, i_ncmp, scmp, nbit_and, nbit_xor, nbit_or */
0x1058, 0x3ef0, 0x0067, /* repeat */
0x3ef0, 0x012f, /* stringify, atan2, rand, srand, index, rindex, crypt, push, unshift, flock, chdir, chown, unlink, chmod, utime, rename, link, symlink, mkdir, waitpid, system, exec, kill, getpgrp, setpgrp, getpriority, setpriority, sleep */
0x33f0, 0x2acc, 0x00cb, /* substr */
/* BIT_AND */ (OPpARG2_MASK),
/* BIT_XOR */ (OPpARG2_MASK),
/* BIT_OR */ (OPpARG2_MASK),
+ /* NBIT_AND */ (OPpARG2_MASK|OPpTARGET_MY),
+ /* NBIT_XOR */ (OPpARG2_MASK|OPpTARGET_MY),
+ /* NBIT_OR */ (OPpARG2_MASK|OPpTARGET_MY),
+ /* SBIT_AND */ (OPpARG2_MASK),
+ /* SBIT_XOR */ (OPpARG2_MASK),
+ /* SBIT_OR */ (OPpARG2_MASK),
/* NEGATE */ (OPpARG1_MASK),
/* I_NEGATE */ (OPpARG1_MASK),
/* NOT */ (OPpARG1_MASK),
/* COMPLEMENT */ (OPpARG1_MASK|OPpTARGET_MY),
+ /* NCOMPLEMENT */ (OPpARG1_MASK|OPpTARGET_MY),
+ /* SCOMPLEMENT */ (OPpARG1_MASK|OPpTARGET_MY),
/* SMARTMATCH */ (OPpARG2_MASK),
/* ATAN2 */ (OPpARG4_MASK|OPpTARGET_MY),
/* SIN */ (OPpARG1_MASK|OPpTARGET_MY),
OP_BIT_AND = 92,
OP_BIT_XOR = 93,
OP_BIT_OR = 94,
- OP_NEGATE = 95,
- OP_I_NEGATE = 96,
- OP_NOT = 97,
- OP_COMPLEMENT = 98,
- OP_SMARTMATCH = 99,
- OP_ATAN2 = 100,
- OP_SIN = 101,
- OP_COS = 102,
- OP_RAND = 103,
- OP_SRAND = 104,
- OP_EXP = 105,
- OP_LOG = 106,
- OP_SQRT = 107,
- OP_INT = 108,
- OP_HEX = 109,
- OP_OCT = 110,
- OP_ABS = 111,
- OP_LENGTH = 112,
- OP_SUBSTR = 113,
- OP_VEC = 114,
- OP_INDEX = 115,
- OP_RINDEX = 116,
- OP_SPRINTF = 117,
- OP_FORMLINE = 118,
- OP_ORD = 119,
- OP_CHR = 120,
- OP_CRYPT = 121,
- OP_UCFIRST = 122,
- OP_LCFIRST = 123,
- OP_UC = 124,
- OP_LC = 125,
- OP_QUOTEMETA = 126,
- OP_RV2AV = 127,
- OP_AELEMFAST = 128,
- OP_AELEMFAST_LEX = 129,
- OP_AELEM = 130,
- OP_ASLICE = 131,
- OP_KVASLICE = 132,
- OP_AEACH = 133,
- OP_AKEYS = 134,
- OP_AVALUES = 135,
- OP_EACH = 136,
- OP_VALUES = 137,
- OP_KEYS = 138,
- OP_DELETE = 139,
- OP_EXISTS = 140,
- OP_RV2HV = 141,
- OP_HELEM = 142,
- OP_HSLICE = 143,
- OP_KVHSLICE = 144,
- OP_MULTIDEREF = 145,
- OP_UNPACK = 146,
- OP_PACK = 147,
- OP_SPLIT = 148,
- OP_JOIN = 149,
- OP_LIST = 150,
- OP_LSLICE = 151,
- OP_ANONLIST = 152,
- OP_ANONHASH = 153,
- OP_SPLICE = 154,
- OP_PUSH = 155,
- OP_POP = 156,
- OP_SHIFT = 157,
- OP_UNSHIFT = 158,
- OP_SORT = 159,
- OP_REVERSE = 160,
- OP_GREPSTART = 161,
- OP_GREPWHILE = 162,
- OP_MAPSTART = 163,
- OP_MAPWHILE = 164,
- OP_RANGE = 165,
- OP_FLIP = 166,
- OP_FLOP = 167,
- OP_AND = 168,
- OP_OR = 169,
- OP_XOR = 170,
- OP_DOR = 171,
- OP_COND_EXPR = 172,
- OP_ANDASSIGN = 173,
- OP_ORASSIGN = 174,
- OP_DORASSIGN = 175,
- OP_METHOD = 176,
- OP_ENTERSUB = 177,
- OP_LEAVESUB = 178,
- OP_LEAVESUBLV = 179,
- OP_CALLER = 180,
- OP_WARN = 181,
- OP_DIE = 182,
- OP_RESET = 183,
- OP_LINESEQ = 184,
- OP_NEXTSTATE = 185,
- OP_DBSTATE = 186,
- OP_UNSTACK = 187,
- OP_ENTER = 188,
- OP_LEAVE = 189,
- OP_SCOPE = 190,
- OP_ENTERITER = 191,
- OP_ITER = 192,
- OP_ENTERLOOP = 193,
- OP_LEAVELOOP = 194,
- OP_RETURN = 195,
- OP_LAST = 196,
- OP_NEXT = 197,
- OP_REDO = 198,
- OP_DUMP = 199,
- OP_GOTO = 200,
- OP_EXIT = 201,
- OP_METHOD_NAMED = 202,
- OP_METHOD_SUPER = 203,
- OP_METHOD_REDIR = 204,
- OP_METHOD_REDIR_SUPER = 205,
- OP_ENTERGIVEN = 206,
- OP_LEAVEGIVEN = 207,
- OP_ENTERWHEN = 208,
- OP_LEAVEWHEN = 209,
- OP_BREAK = 210,
- OP_CONTINUE = 211,
- OP_OPEN = 212,
- OP_CLOSE = 213,
- OP_PIPE_OP = 214,
- OP_FILENO = 215,
- OP_UMASK = 216,
- OP_BINMODE = 217,
- OP_TIE = 218,
- OP_UNTIE = 219,
- OP_TIED = 220,
- OP_DBMOPEN = 221,
- OP_DBMCLOSE = 222,
- OP_SSELECT = 223,
- OP_SELECT = 224,
- OP_GETC = 225,
- OP_READ = 226,
- OP_ENTERWRITE = 227,
- OP_LEAVEWRITE = 228,
- OP_PRTF = 229,
- OP_PRINT = 230,
- OP_SAY = 231,
- OP_SYSOPEN = 232,
- OP_SYSSEEK = 233,
- OP_SYSREAD = 234,
- OP_SYSWRITE = 235,
- OP_EOF = 236,
- OP_TELL = 237,
- OP_SEEK = 238,
- OP_TRUNCATE = 239,
- OP_FCNTL = 240,
- OP_IOCTL = 241,
- OP_FLOCK = 242,
- OP_SEND = 243,
- OP_RECV = 244,
- OP_SOCKET = 245,
- OP_SOCKPAIR = 246,
- OP_BIND = 247,
- OP_CONNECT = 248,
- OP_LISTEN = 249,
- OP_ACCEPT = 250,
- OP_SHUTDOWN = 251,
- OP_GSOCKOPT = 252,
- OP_SSOCKOPT = 253,
- OP_GETSOCKNAME = 254,
- OP_GETPEERNAME = 255,
- OP_LSTAT = 256,
- OP_STAT = 257,
- OP_FTRREAD = 258,
- OP_FTRWRITE = 259,
- OP_FTREXEC = 260,
- OP_FTEREAD = 261,
- OP_FTEWRITE = 262,
- OP_FTEEXEC = 263,
- OP_FTIS = 264,
- OP_FTSIZE = 265,
- OP_FTMTIME = 266,
- OP_FTATIME = 267,
- OP_FTCTIME = 268,
- OP_FTROWNED = 269,
- OP_FTEOWNED = 270,
- OP_FTZERO = 271,
- OP_FTSOCK = 272,
- OP_FTCHR = 273,
- OP_FTBLK = 274,
- OP_FTFILE = 275,
- OP_FTDIR = 276,
- OP_FTPIPE = 277,
- OP_FTSUID = 278,
- OP_FTSGID = 279,
- OP_FTSVTX = 280,
- OP_FTLINK = 281,
- OP_FTTTY = 282,
- OP_FTTEXT = 283,
- OP_FTBINARY = 284,
- OP_CHDIR = 285,
- OP_CHOWN = 286,
- OP_CHROOT = 287,
- OP_UNLINK = 288,
- OP_CHMOD = 289,
- OP_UTIME = 290,
- OP_RENAME = 291,
- OP_LINK = 292,
- OP_SYMLINK = 293,
- OP_READLINK = 294,
- OP_MKDIR = 295,
- OP_RMDIR = 296,
- OP_OPEN_DIR = 297,
- OP_READDIR = 298,
- OP_TELLDIR = 299,
- OP_SEEKDIR = 300,
- OP_REWINDDIR = 301,
- OP_CLOSEDIR = 302,
- OP_FORK = 303,
- OP_WAIT = 304,
- OP_WAITPID = 305,
- OP_SYSTEM = 306,
- OP_EXEC = 307,
- OP_KILL = 308,
- OP_GETPPID = 309,
- OP_GETPGRP = 310,
- OP_SETPGRP = 311,
- OP_GETPRIORITY = 312,
- OP_SETPRIORITY = 313,
- OP_TIME = 314,
- OP_TMS = 315,
- OP_LOCALTIME = 316,
- OP_GMTIME = 317,
- OP_ALARM = 318,
- OP_SLEEP = 319,
- OP_SHMGET = 320,
- OP_SHMCTL = 321,
- OP_SHMREAD = 322,
- OP_SHMWRITE = 323,
- OP_MSGGET = 324,
- OP_MSGCTL = 325,
- OP_MSGSND = 326,
- OP_MSGRCV = 327,
- OP_SEMOP = 328,
- OP_SEMGET = 329,
- OP_SEMCTL = 330,
- OP_REQUIRE = 331,
- OP_DOFILE = 332,
- OP_HINTSEVAL = 333,
- OP_ENTEREVAL = 334,
- OP_LEAVEEVAL = 335,
- OP_ENTERTRY = 336,
- OP_LEAVETRY = 337,
- OP_GHBYNAME = 338,
- OP_GHBYADDR = 339,
- OP_GHOSTENT = 340,
- OP_GNBYNAME = 341,
- OP_GNBYADDR = 342,
- OP_GNETENT = 343,
- OP_GPBYNAME = 344,
- OP_GPBYNUMBER = 345,
- OP_GPROTOENT = 346,
- OP_GSBYNAME = 347,
- OP_GSBYPORT = 348,
- OP_GSERVENT = 349,
- OP_SHOSTENT = 350,
- OP_SNETENT = 351,
- OP_SPROTOENT = 352,
- OP_SSERVENT = 353,
- OP_EHOSTENT = 354,
- OP_ENETENT = 355,
- OP_EPROTOENT = 356,
- OP_ESERVENT = 357,
- OP_GPWNAM = 358,
- OP_GPWUID = 359,
- OP_GPWENT = 360,
- OP_SPWENT = 361,
- OP_EPWENT = 362,
- OP_GGRNAM = 363,
- OP_GGRGID = 364,
- OP_GGRENT = 365,
- OP_SGRENT = 366,
- OP_EGRENT = 367,
- OP_GETLOGIN = 368,
- OP_SYSCALL = 369,
- OP_LOCK = 370,
- OP_ONCE = 371,
- OP_CUSTOM = 372,
- OP_REACH = 373,
- OP_RKEYS = 374,
- OP_RVALUES = 375,
- OP_COREARGS = 376,
- OP_RUNCV = 377,
- OP_FC = 378,
- OP_PADCV = 379,
- OP_INTROCV = 380,
- OP_CLONECV = 381,
- OP_PADRANGE = 382,
- OP_REFASSIGN = 383,
- OP_LVREF = 384,
- OP_LVREFSLICE = 385,
- OP_LVAVREF = 386,
- OP_ANONCONST = 387,
+ OP_NBIT_AND = 95,
+ OP_NBIT_XOR = 96,
+ OP_NBIT_OR = 97,
+ OP_SBIT_AND = 98,
+ OP_SBIT_XOR = 99,
+ OP_SBIT_OR = 100,
+ OP_NEGATE = 101,
+ OP_I_NEGATE = 102,
+ OP_NOT = 103,
+ OP_COMPLEMENT = 104,
+ OP_NCOMPLEMENT = 105,
+ OP_SCOMPLEMENT = 106,
+ OP_SMARTMATCH = 107,
+ OP_ATAN2 = 108,
+ OP_SIN = 109,
+ OP_COS = 110,
+ OP_RAND = 111,
+ OP_SRAND = 112,
+ OP_EXP = 113,
+ OP_LOG = 114,
+ OP_SQRT = 115,
+ OP_INT = 116,
+ OP_HEX = 117,
+ OP_OCT = 118,
+ OP_ABS = 119,
+ OP_LENGTH = 120,
+ OP_SUBSTR = 121,
+ OP_VEC = 122,
+ OP_INDEX = 123,
+ OP_RINDEX = 124,
+ OP_SPRINTF = 125,
+ OP_FORMLINE = 126,
+ OP_ORD = 127,
+ OP_CHR = 128,
+ OP_CRYPT = 129,
+ OP_UCFIRST = 130,
+ OP_LCFIRST = 131,
+ OP_UC = 132,
+ OP_LC = 133,
+ OP_QUOTEMETA = 134,
+ OP_RV2AV = 135,
+ OP_AELEMFAST = 136,
+ OP_AELEMFAST_LEX = 137,
+ OP_AELEM = 138,
+ OP_ASLICE = 139,
+ OP_KVASLICE = 140,
+ OP_AEACH = 141,
+ OP_AKEYS = 142,
+ OP_AVALUES = 143,
+ OP_EACH = 144,
+ OP_VALUES = 145,
+ OP_KEYS = 146,
+ OP_DELETE = 147,
+ OP_EXISTS = 148,
+ OP_RV2HV = 149,
+ OP_HELEM = 150,
+ OP_HSLICE = 151,
+ OP_KVHSLICE = 152,
+ OP_MULTIDEREF = 153,
+ OP_UNPACK = 154,
+ OP_PACK = 155,
+ OP_SPLIT = 156,
+ OP_JOIN = 157,
+ OP_LIST = 158,
+ OP_LSLICE = 159,
+ OP_ANONLIST = 160,
+ OP_ANONHASH = 161,
+ OP_SPLICE = 162,
+ OP_PUSH = 163,
+ OP_POP = 164,
+ OP_SHIFT = 165,
+ OP_UNSHIFT = 166,
+ OP_SORT = 167,
+ OP_REVERSE = 168,
+ OP_GREPSTART = 169,
+ OP_GREPWHILE = 170,
+ OP_MAPSTART = 171,
+ OP_MAPWHILE = 172,
+ OP_RANGE = 173,
+ OP_FLIP = 174,
+ OP_FLOP = 175,
+ OP_AND = 176,
+ OP_OR = 177,
+ OP_XOR = 178,
+ OP_DOR = 179,
+ OP_COND_EXPR = 180,
+ OP_ANDASSIGN = 181,
+ OP_ORASSIGN = 182,
+ OP_DORASSIGN = 183,
+ OP_METHOD = 184,
+ OP_ENTERSUB = 185,
+ OP_LEAVESUB = 186,
+ OP_LEAVESUBLV = 187,
+ OP_CALLER = 188,
+ OP_WARN = 189,
+ OP_DIE = 190,
+ OP_RESET = 191,
+ OP_LINESEQ = 192,
+ OP_NEXTSTATE = 193,
+ OP_DBSTATE = 194,
+ OP_UNSTACK = 195,
+ OP_ENTER = 196,
+ OP_LEAVE = 197,
+ OP_SCOPE = 198,
+ OP_ENTERITER = 199,
+ OP_ITER = 200,
+ OP_ENTERLOOP = 201,
+ OP_LEAVELOOP = 202,
+ OP_RETURN = 203,
+ OP_LAST = 204,
+ OP_NEXT = 205,
+ OP_REDO = 206,
+ OP_DUMP = 207,
+ OP_GOTO = 208,
+ OP_EXIT = 209,
+ OP_METHOD_NAMED = 210,
+ OP_METHOD_SUPER = 211,
+ OP_METHOD_REDIR = 212,
+ OP_METHOD_REDIR_SUPER = 213,
+ OP_ENTERGIVEN = 214,
+ OP_LEAVEGIVEN = 215,
+ OP_ENTERWHEN = 216,
+ OP_LEAVEWHEN = 217,
+ OP_BREAK = 218,
+ OP_CONTINUE = 219,
+ OP_OPEN = 220,
+ OP_CLOSE = 221,
+ OP_PIPE_OP = 222,
+ OP_FILENO = 223,
+ OP_UMASK = 224,
+ OP_BINMODE = 225,
+ OP_TIE = 226,
+ OP_UNTIE = 227,
+ OP_TIED = 228,
+ OP_DBMOPEN = 229,
+ OP_DBMCLOSE = 230,
+ OP_SSELECT = 231,
+ OP_SELECT = 232,
+ OP_GETC = 233,
+ OP_READ = 234,
+ OP_ENTERWRITE = 235,
+ OP_LEAVEWRITE = 236,
+ OP_PRTF = 237,
+ OP_PRINT = 238,
+ OP_SAY = 239,
+ OP_SYSOPEN = 240,
+ OP_SYSSEEK = 241,
+ OP_SYSREAD = 242,
+ OP_SYSWRITE = 243,
+ OP_EOF = 244,
+ OP_TELL = 245,
+ OP_SEEK = 246,
+ OP_TRUNCATE = 247,
+ OP_FCNTL = 248,
+ OP_IOCTL = 249,
+ OP_FLOCK = 250,
+ OP_SEND = 251,
+ OP_RECV = 252,
+ OP_SOCKET = 253,
+ OP_SOCKPAIR = 254,
+ OP_BIND = 255,
+ OP_CONNECT = 256,
+ OP_LISTEN = 257,
+ OP_ACCEPT = 258,
+ OP_SHUTDOWN = 259,
+ OP_GSOCKOPT = 260,
+ OP_SSOCKOPT = 261,
+ OP_GETSOCKNAME = 262,
+ OP_GETPEERNAME = 263,
+ OP_LSTAT = 264,
+ OP_STAT = 265,
+ OP_FTRREAD = 266,
+ OP_FTRWRITE = 267,
+ OP_FTREXEC = 268,
+ OP_FTEREAD = 269,
+ OP_FTEWRITE = 270,
+ OP_FTEEXEC = 271,
+ OP_FTIS = 272,
+ OP_FTSIZE = 273,
+ OP_FTMTIME = 274,
+ OP_FTATIME = 275,
+ OP_FTCTIME = 276,
+ OP_FTROWNED = 277,
+ OP_FTEOWNED = 278,
+ OP_FTZERO = 279,
+ OP_FTSOCK = 280,
+ OP_FTCHR = 281,
+ OP_FTBLK = 282,
+ OP_FTFILE = 283,
+ OP_FTDIR = 284,
+ OP_FTPIPE = 285,
+ OP_FTSUID = 286,
+ OP_FTSGID = 287,
+ OP_FTSVTX = 288,
+ OP_FTLINK = 289,
+ OP_FTTTY = 290,
+ OP_FTTEXT = 291,
+ OP_FTBINARY = 292,
+ OP_CHDIR = 293,
+ OP_CHOWN = 294,
+ OP_CHROOT = 295,
+ OP_UNLINK = 296,
+ OP_CHMOD = 297,
+ OP_UTIME = 298,
+ OP_RENAME = 299,
+ OP_LINK = 300,
+ OP_SYMLINK = 301,
+ OP_READLINK = 302,
+ OP_MKDIR = 303,
+ OP_RMDIR = 304,
+ OP_OPEN_DIR = 305,
+ OP_READDIR = 306,
+ OP_TELLDIR = 307,
+ OP_SEEKDIR = 308,
+ OP_REWINDDIR = 309,
+ OP_CLOSEDIR = 310,
+ OP_FORK = 311,
+ OP_WAIT = 312,
+ OP_WAITPID = 313,
+ OP_SYSTEM = 314,
+ OP_EXEC = 315,
+ OP_KILL = 316,
+ OP_GETPPID = 317,
+ OP_GETPGRP = 318,
+ OP_SETPGRP = 319,
+ OP_GETPRIORITY = 320,
+ OP_SETPRIORITY = 321,
+ OP_TIME = 322,
+ OP_TMS = 323,
+ OP_LOCALTIME = 324,
+ OP_GMTIME = 325,
+ OP_ALARM = 326,
+ OP_SLEEP = 327,
+ OP_SHMGET = 328,
+ OP_SHMCTL = 329,
+ OP_SHMREAD = 330,
+ OP_SHMWRITE = 331,
+ OP_MSGGET = 332,
+ OP_MSGCTL = 333,
+ OP_MSGSND = 334,
+ OP_MSGRCV = 335,
+ OP_SEMOP = 336,
+ OP_SEMGET = 337,
+ OP_SEMCTL = 338,
+ OP_REQUIRE = 339,
+ OP_DOFILE = 340,
+ OP_HINTSEVAL = 341,
+ OP_ENTEREVAL = 342,
+ OP_LEAVEEVAL = 343,
+ OP_ENTERTRY = 344,
+ OP_LEAVETRY = 345,
+ OP_GHBYNAME = 346,
+ OP_GHBYADDR = 347,
+ OP_GHOSTENT = 348,
+ OP_GNBYNAME = 349,
+ OP_GNBYADDR = 350,
+ OP_GNETENT = 351,
+ OP_GPBYNAME = 352,
+ OP_GPBYNUMBER = 353,
+ OP_GPROTOENT = 354,
+ OP_GSBYNAME = 355,
+ OP_GSBYPORT = 356,
+ OP_GSERVENT = 357,
+ OP_SHOSTENT = 358,
+ OP_SNETENT = 359,
+ OP_SPROTOENT = 360,
+ OP_SSERVENT = 361,
+ OP_EHOSTENT = 362,
+ OP_ENETENT = 363,
+ OP_EPROTOENT = 364,
+ OP_ESERVENT = 365,
+ OP_GPWNAM = 366,
+ OP_GPWUID = 367,
+ OP_GPWENT = 368,
+ OP_SPWENT = 369,
+ OP_EPWENT = 370,
+ OP_GGRNAM = 371,
+ OP_GGRGID = 372,
+ OP_GGRENT = 373,
+ OP_SGRENT = 374,
+ OP_EGRENT = 375,
+ OP_GETLOGIN = 376,
+ OP_SYSCALL = 377,
+ OP_LOCK = 378,
+ OP_ONCE = 379,
+ OP_CUSTOM = 380,
+ OP_REACH = 381,
+ OP_RKEYS = 382,
+ OP_RVALUES = 383,
+ OP_COREARGS = 384,
+ OP_RUNCV = 385,
+ OP_FC = 386,
+ OP_PADCV = 387,
+ OP_INTROCV = 388,
+ OP_CLONECV = 389,
+ OP_PADRANGE = 390,
+ OP_REFASSIGN = 391,
+ OP_LVREF = 392,
+ OP_LVREFSLICE = 393,
+ OP_LVAVREF = 394,
+ OP_ANONCONST = 395,
OP_max
} opcode;
-#define MAXO 388
+#define MAXO 396
#define OP_FREED MAXO
/* the OP_IS_* macros are optimized to a simple range check because
#define OP_IS_DIRHOP(op) \
((op) >= OP_READDIR && (op) <= OP_CLOSEDIR)
+#define OP_IS_INFIX_BIT(op) \
+ ((op) >= OP_BIT_AND && (op) <= OP_SBIT_OR)
+
/* ex: set ro: */
4,
2,
3,
+ 3,
+ 4,
2,
3,
+ 3,
+ 4,
2,
3,
+ 3,
+ 4,
4,
4,
2,
+ 3,
6,
4,
4,
"(>>=", /* rshift_ass */
"(&", /* band */
"(&=", /* band_ass */
+ "(&.", /* sband */
+ "(&.=", /* sband_ass */
"(|", /* bor */
"(|=", /* bor_ass */
+ "(|.", /* sbor */
+ "(|.=", /* sbor_ass */
"(^", /* bxor */
"(^=", /* bxor_ass */
+ "(^.", /* sbxor */
+ "(^.=", /* sbxor_ass */
"(<=>", /* ncmp */
"(cmp", /* scmp */
"(~", /* compl */
+ "(~.", /* scompl */
"(atan2", /* atan2 */
"(cos", /* cos */
"(sin", /* sin */
rshift_ass_amg, /* 0x2d >>= */
band_amg, /* 0x2e & */
band_ass_amg, /* 0x2f &= */
- bor_amg, /* 0x30 | */
- bor_ass_amg, /* 0x31 |= */
- bxor_amg, /* 0x32 ^ */
- bxor_ass_amg, /* 0x33 ^= */
- ncmp_amg, /* 0x34 <=> */
- scmp_amg, /* 0x35 cmp */
- compl_amg, /* 0x36 ~ */
- atan2_amg, /* 0x37 atan2 */
- cos_amg, /* 0x38 cos */
- sin_amg, /* 0x39 sin */
- exp_amg, /* 0x3a exp */
- log_amg, /* 0x3b log */
- sqrt_amg, /* 0x3c sqrt */
- repeat_amg, /* 0x3d x */
- repeat_ass_amg, /* 0x3e x= */
- concat_amg, /* 0x3f . */
- concat_ass_amg, /* 0x40 .= */
- smart_amg, /* 0x41 ~~ */
- ftest_amg, /* 0x42 -X */
- regexp_amg, /* 0x43 qr */
+ sband_amg, /* 0x30 &. */
+ sband_ass_amg, /* 0x31 &.= */
+ bor_amg, /* 0x32 | */
+ bor_ass_amg, /* 0x33 |= */
+ sbor_amg, /* 0x34 |. */
+ sbor_ass_amg, /* 0x35 |.= */
+ bxor_amg, /* 0x36 ^ */
+ bxor_ass_amg, /* 0x37 ^= */
+ sbxor_amg, /* 0x38 ^. */
+ sbxor_ass_amg, /* 0x39 ^.= */
+ ncmp_amg, /* 0x3a <=> */
+ scmp_amg, /* 0x3b cmp */
+ compl_amg, /* 0x3c ~ */
+ scompl_amg, /* 0x3d ~. */
+ atan2_amg, /* 0x3e atan2 */
+ cos_amg, /* 0x3f cos */
+ sin_amg, /* 0x40 sin */
+ exp_amg, /* 0x41 exp */
+ log_amg, /* 0x42 log */
+ sqrt_amg, /* 0x43 sqrt */
+ repeat_amg, /* 0x44 x */
+ repeat_ass_amg, /* 0x45 x= */
+ concat_amg, /* 0x46 . */
+ concat_ass_amg, /* 0x47 .= */
+ smart_amg, /* 0x48 ~~ */
+ ftest_amg, /* 0x49 -X */
+ regexp_amg, /* 0x4a qr */
max_amg_code
/* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */
};
#line 115 "perly.y"
{
parser->expect = XSTATE;
- }
+ ;}
break;
case 3:
newPROG(block_end((ps[(3) - (4)].val.ival),(ps[(4) - (4)].val.opval)));
PL_compiling.cop_seq = 0;
(yyval.ival) = 0;
- }
+ ;}
break;
case 4:
#line 125 "perly.y"
{
parser->expect = XTERM;
- }
+ ;}
break;
case 5:
{
PL_eval_root = (ps[(3) - (3)].val.opval);
(yyval.ival) = 0;
- }
+ ;}
break;
case 6:
#line 134 "perly.y"
{
parser->expect = XBLOCK;
- }
+ ;}
break;
case 7:
(yyval.ival) = 0;
yyunlex();
parser->yychar = YYEOF;
- }
+ ;}
break;
case 8:
#line 146 "perly.y"
{
parser->expect = XSTATE;
- }
+ ;}
break;
case 9:
(yyval.ival) = 0;
yyunlex();
parser->yychar = YYEOF;
- }
+ ;}
break;
case 10:
#line 158 "perly.y"
{
parser->expect = XSTATE;
- }
+ ;}
break;
case 11:
(yyval.ival) = 0;
yyunlex();
parser->yychar = YYEOF;
- }
+ ;}
break;
case 12:
#line 170 "perly.y"
{
parser->expect = XSTATE;
- }
+ ;}
break;
case 13:
{
PL_eval_root = (ps[(3) - (3)].val.opval);
(yyval.ival) = 0;
- }
+ ;}
break;
case 14:
{ if (parser->copline > (line_t)(ps[(1) - (4)].val.ival))
parser->copline = (line_t)(ps[(1) - (4)].val.ival);
(yyval.opval) = block_end((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval));
- }
+ ;}
break;
case 15:
{ if (parser->copline > (line_t)(ps[(1) - (7)].val.ival))
parser->copline = (line_t)(ps[(1) - (7)].val.ival);
(yyval.opval) = block_end((ps[(2) - (7)].val.ival), (ps[(5) - (7)].val.opval));
- }
+ ;}
break;
case 16:
#line 197 "perly.y"
{ (yyval.ival) = block_start(TRUE);
- parser->parsed_sub = 0; }
+ parser->parsed_sub = 0; ;}
break;
case 17:
{ if (parser->copline > (line_t)(ps[(1) - (4)].val.ival))
parser->copline = (line_t)(ps[(1) - (4)].val.ival);
(yyval.opval) = block_end((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval));
- }
+ ;}
break;
case 18:
#line 209 "perly.y"
{ (yyval.ival) = block_start(FALSE);
- parser->parsed_sub = 0; }
+ parser->parsed_sub = 0; ;}
break;
case 19:
#line 215 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 20:
PL_pad_reset_pending = TRUE;
if ((ps[(1) - (2)].val.opval) && (ps[(2) - (2)].val.opval))
PL_hints |= HINT_BLOCK_SCOPE;
- }
+ ;}
break;
case 21:
#line 226 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 22:
PL_pad_reset_pending = TRUE;
if ((ps[(1) - (2)].val.opval) && (ps[(2) - (2)].val.opval))
PL_hints |= HINT_BLOCK_SCOPE;
- }
+ ;}
break;
case 23:
#line 237 "perly.y"
{
(yyval.opval) = (ps[(1) - (1)].val.opval) ? newSTATEOP(0, NULL, (ps[(1) - (1)].val.opval)) : NULL;
- }
+ ;}
break;
case 24:
#line 241 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 25:
#line 245 "perly.y"
{
(yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[(1) - (2)].val.pval)[strlen((ps[(1) - (2)].val.pval))+1], (ps[(1) - (2)].val.pval), (ps[(2) - (2)].val.opval));
- }
+ ;}
break;
case 26:
#line 249 "perly.y"
{
(yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[(1) - (2)].val.pval)[strlen((ps[(1) - (2)].val.pval))+1], (ps[(1) - (2)].val.pval), (ps[(2) - (2)].val.opval));
- }
+ ;}
break;
case 27:
#line 256 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 28:
pad_add_weakref(fmtcv);
}
parser->parsed_sub = 1;
- }
+ ;}
break;
case 29:
CvCLONE_on(PL_compcv);
parser->in_my = 0;
parser->in_my_stash = NULL;
- }
+ ;}
break;
case 30:
(yyval.opval) = (OP*)NULL;
intro_my();
parser->parsed_sub = 1;
- }
+ ;}
break;
case 31:
CvCLONE_on(PL_compcv);
parser->in_my = 0;
parser->in_my_stash = NULL;
- }
+ ;}
break;
case 32:
(yyval.opval) = (OP*)NULL;
intro_my();
parser->parsed_sub = 1;
- }
+ ;}
break;
case 33:
if ((ps[(2) - (4)].val.opval))
package_version((ps[(2) - (4)].val.opval));
(yyval.opval) = (OP*)NULL;
- }
+ ;}
break;
case 34:
#line 347 "perly.y"
- { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
+ { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;}
break;
case 35:
utilize((ps[(1) - (7)].val.ival), (ps[(2) - (7)].val.ival), (ps[(4) - (7)].val.opval), (ps[(5) - (7)].val.opval), (ps[(6) - (7)].val.opval));
parser->parsed_sub = 1;
(yyval.opval) = (OP*)NULL;
- }
+ ;}
break;
case 36:
(yyval.opval) = block_end((ps[(3) - (7)].val.ival),
newCONDOP(0, (ps[(4) - (7)].val.opval), op_scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval)));
parser->copline = (line_t)(ps[(1) - (7)].val.ival);
- }
+ ;}
break;
case 37:
(yyval.opval) = block_end((ps[(3) - (7)].val.ival),
newCONDOP(0, (ps[(4) - (7)].val.opval), op_scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval)));
parser->copline = (line_t)(ps[(1) - (7)].val.ival);
- }
+ ;}
break;
case 38:
? 0
: offset));
parser->copline = (line_t)(ps[(1) - (6)].val.ival);
- }
+ ;}
break;
case 39:
#line 379 "perly.y"
- { (yyval.opval) = block_end((ps[(3) - (6)].val.ival), newWHENOP((ps[(4) - (6)].val.opval), op_scope((ps[(6) - (6)].val.opval)))); }
+ { (yyval.opval) = block_end((ps[(3) - (6)].val.ival), newWHENOP((ps[(4) - (6)].val.opval), op_scope((ps[(6) - (6)].val.opval)))); ;}
break;
case 40:
#line 381 "perly.y"
- { (yyval.opval) = newWHENOP(0, op_scope((ps[(2) - (2)].val.opval))); }
+ { (yyval.opval) = newWHENOP(0, op_scope((ps[(2) - (2)].val.opval))); ;}
break;
case 41:
newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
(ps[(4) - (8)].val.opval), (ps[(7) - (8)].val.opval), (ps[(8) - (8)].val.opval), (ps[(6) - (8)].val.ival)));
parser->copline = (line_t)(ps[(1) - (8)].val.ival);
- }
+ ;}
break;
case 42:
newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
(ps[(4) - (8)].val.opval), (ps[(7) - (8)].val.opval), (ps[(8) - (8)].val.opval), (ps[(6) - (8)].val.ival)));
parser->copline = (line_t)(ps[(1) - (8)].val.ival);
- }
+ ;}
break;
case 43:
#line 397 "perly.y"
- { parser->expect = XTERM; }
+ { parser->expect = XTERM; ;}
break;
case 44:
#line 399 "perly.y"
- { parser->expect = XTERM; }
+ { parser->expect = XTERM; ;}
break;
case 45:
PL_hints |= HINT_BLOCK_SCOPE;
(yyval.opval) = block_end((ps[(3) - (13)].val.ival), forop);
parser->copline = (line_t)(ps[(1) - (13)].val.ival);
- }
+ ;}
break;
case 46:
{
(yyval.opval) = block_end((ps[(3) - (9)].val.ival), newFOROP(0, (ps[(4) - (9)].val.opval), (ps[(6) - (9)].val.opval), (ps[(8) - (9)].val.opval), (ps[(9) - (9)].val.opval)));
parser->copline = (line_t)(ps[(1) - (9)].val.ival);
- }
+ ;}
break;
case 47:
(yyval.opval) = block_end((ps[(4) - (8)].val.ival), newFOROP(0,
op_lvalue((ps[(2) - (8)].val.opval), OP_ENTERLOOP), (ps[(5) - (8)].val.opval), (ps[(7) - (8)].val.opval), (ps[(8) - (8)].val.opval)));
parser->copline = (line_t)(ps[(1) - (8)].val.ival);
- }
+ ;}
break;
case 48:
#line 428 "perly.y"
- { parser->in_my = 0; (yyval.opval) = my((ps[(5) - (5)].val.opval)); }
+ { parser->in_my = 0; (yyval.opval) = my((ps[(5) - (5)].val.opval)); ;}
break;
case 49:
(ps[(8) - (11)].val.opval), (ps[(10) - (11)].val.opval), (ps[(11) - (11)].val.opval))
);
parser->copline = (line_t)(ps[(1) - (11)].val.ival);
- }
+ ;}
break;
case 50:
(ps[(3) - (9)].val.opval)),
OP_ENTERLOOP), (ps[(6) - (9)].val.opval), (ps[(8) - (9)].val.opval), (ps[(9) - (9)].val.opval)));
parser->copline = (line_t)(ps[(1) - (9)].val.ival);
- }
+ ;}
break;
case 51:
(yyval.opval) = block_end((ps[(3) - (7)].val.ival),
newFOROP(0, (OP*)NULL, (ps[(4) - (7)].val.opval), (ps[(6) - (7)].val.opval), (ps[(7) - (7)].val.opval)));
parser->copline = (line_t)(ps[(1) - (7)].val.ival);
- }
+ ;}
break;
case 52:
/* a block is a loop that happens once */
(yyval.opval) = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
(OP*)NULL, (ps[(1) - (2)].val.opval), (ps[(2) - (2)].val.opval), 0);
- }
+ ;}
break;
case 53:
if ((ps[(2) - (5)].val.opval)) {
package_version((ps[(2) - (5)].val.opval));
}
- }
+ ;}
break;
case 54:
(OP*)NULL, block_end((ps[(5) - (8)].val.ival), (ps[(7) - (8)].val.opval)), (OP*)NULL, 0);
if (parser->copline > (line_t)(ps[(4) - (8)].val.ival))
parser->copline = (line_t)(ps[(4) - (8)].val.ival);
- }
+ ;}
break;
case 55:
#line 478 "perly.y"
{
(yyval.opval) = (ps[(1) - (2)].val.opval);
- }
+ ;}
break;
case 56:
{
(yyval.opval) = (OP*)NULL;
parser->copline = NOLINE;
- }
+ ;}
break;
case 57:
else parser->copline--;
(yyval.opval) = newSTATEOP(0, NULL,
op_convert_list(OP_FORMLINE, 0, list));
- }
+ ;}
break;
case 58:
#line 507 "perly.y"
- { (yyval.opval) = NULL; }
+ { (yyval.opval) = NULL; ;}
break;
case 59:
#line 509 "perly.y"
- { (yyval.opval) = op_unscope((ps[(2) - (3)].val.opval)); }
+ { (yyval.opval) = op_unscope((ps[(2) - (3)].val.opval)); ;}
break;
case 60:
#line 514 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 61:
#line 516 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 62:
#line 518 "perly.y"
- { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); ;}
break;
case 63:
#line 520 "perly.y"
- { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); ;}
break;
case 64:
#line 522 "perly.y"
- { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[(3) - (3)].val.opval)), (ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[(3) - (3)].val.opval)), (ps[(1) - (3)].val.opval)); ;}
break;
case 65:
#line 524 "perly.y"
- { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval)); ;}
break;
case 66:
#line 526 "perly.y"
{ (yyval.opval) = newFOROP(0, (OP*)NULL, (ps[(3) - (3)].val.opval), (ps[(1) - (3)].val.opval), (OP*)NULL);
- parser->copline = (line_t)(ps[(2) - (3)].val.ival); }
+ parser->copline = (line_t)(ps[(2) - (3)].val.ival); ;}
break;
case 67:
#line 529 "perly.y"
- { (yyval.opval) = newWHENOP((ps[(3) - (3)].val.opval), op_scope((ps[(1) - (3)].val.opval))); }
+ { (yyval.opval) = newWHENOP((ps[(3) - (3)].val.opval), op_scope((ps[(1) - (3)].val.opval))); ;}
break;
case 68:
#line 534 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 69:
{
((ps[(2) - (2)].val.opval))->op_flags |= OPf_PARENS;
(yyval.opval) = op_scope((ps[(2) - (2)].val.opval));
- }
+ ;}
break;
case 70:
newSTATEOP(OPf_SPECIAL,NULL,(ps[(3) - (6)].val.opval)),
op_scope((ps[(5) - (6)].val.opval)), (ps[(6) - (6)].val.opval));
PL_hints |= HINT_BLOCK_SCOPE;
- }
+ ;}
break;
case 71:
#line 551 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 72:
#line 553 "perly.y"
- { (yyval.opval) = op_scope((ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = op_scope((ps[(2) - (2)].val.opval)); ;}
break;
case 73:
#line 558 "perly.y"
{ (yyval.ival) = (PL_min_intro_pending &&
PL_max_intro_pending >= PL_min_intro_pending);
- intro_my(); }
+ intro_my(); ;}
break;
case 74:
#line 564 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 76:
#line 570 "perly.y"
{ YYSTYPE tmplval;
(void)scan_num("1", &tmplval);
- (yyval.opval) = tmplval.opval; }
+ (yyval.opval) = tmplval.opval; ;}
break;
case 78:
#line 578 "perly.y"
- { (yyval.opval) = invert(scalar((ps[(1) - (1)].val.opval))); }
+ { (yyval.opval) = invert(scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 79:
#line 583 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;}
break;
case 80:
#line 587 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;}
break;
case 81:
#line 591 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); ;}
break;
case 82:
#line 594 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 83:
#line 595 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 84:
#line 599 "perly.y"
{ (yyval.ival) = start_subparse(FALSE, 0);
- SAVEFREESV(PL_compcv); }
+ SAVEFREESV(PL_compcv); ;}
break;
case 85:
#line 605 "perly.y"
{ (yyval.ival) = start_subparse(FALSE, CVf_ANON);
- SAVEFREESV(PL_compcv); }
+ SAVEFREESV(PL_compcv); ;}
break;
case 86:
#line 610 "perly.y"
{ (yyval.ival) = start_subparse(TRUE, 0);
- SAVEFREESV(PL_compcv); }
+ SAVEFREESV(PL_compcv); ;}
break;
case 89:
#line 621 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 91:
#line 627 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 92:
#line 629 "perly.y"
- { (yyval.opval) = (ps[(2) - (2)].val.opval); }
+ { (yyval.opval) = (ps[(2) - (2)].val.opval); ;}
break;
case 93:
#line 631 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 94:
#line 636 "perly.y"
- { (yyval.opval) = (ps[(2) - (2)].val.opval); }
+ { (yyval.opval) = (ps[(2) - (2)].val.opval); ;}
break;
case 95:
#line 638 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 96:
packWARN(WARN_EXPERIMENTAL__SIGNATURES),
"The signatures feature is experimental");
(yyval.opval) = parse_subsignature();
- }
+ ;}
break;
case 97:
(yyval.opval) = op_append_list(OP_LINESEQ, (ps[(2) - (3)].val.opval),
newSTATEOP(0, NULL, sawparens(newNULLLIST())));
parser->expect = XATTRBLOCK;
- }
+ ;}
break;
case 99:
#line 662 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 100:
#line 667 "perly.y"
- { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 101:
#line 669 "perly.y"
- { (yyval.opval) = newLOGOP((ps[(2) - (3)].val.ival), 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP((ps[(2) - (3)].val.ival), 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 102:
#line 671 "perly.y"
- { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 104:
#line 677 "perly.y"
- { (yyval.opval) = (ps[(1) - (2)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (2)].val.opval); ;}
break;
case 105:
{
OP* term = (ps[(3) - (3)].val.opval);
(yyval.opval) = op_append_elem(OP_LIST, (ps[(1) - (3)].val.opval), term);
- }
+ ;}
break;
case 107:
#line 688 "perly.y"
{ (yyval.opval) = op_convert_list((ps[(1) - (3)].val.ival), OPf_STACKED,
op_prepend_elem(OP_LIST, newGVREF((ps[(1) - (3)].val.ival),(ps[(2) - (3)].val.opval)), (ps[(3) - (3)].val.opval)) );
- }
+ ;}
break;
case 108:
#line 692 "perly.y"
{ (yyval.opval) = op_convert_list((ps[(1) - (5)].val.ival), OPf_STACKED,
op_prepend_elem(OP_LIST, newGVREF((ps[(1) - (5)].val.ival),(ps[(3) - (5)].val.opval)), (ps[(4) - (5)].val.opval)) );
- }
+ ;}
break;
case 109:
op_append_elem(OP_LIST,
op_prepend_elem(OP_LIST, scalar((ps[(1) - (6)].val.opval)), (ps[(5) - (6)].val.opval)),
newMETHOP(OP_METHOD, 0, (ps[(3) - (6)].val.opval))));
- }
+ ;}
break;
case 110:
{ (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, scalar((ps[(1) - (3)].val.opval)),
newMETHOP(OP_METHOD, 0, (ps[(3) - (3)].val.opval))));
- }
+ ;}
break;
case 111:
op_append_elem(OP_LIST,
op_prepend_elem(OP_LIST, (ps[(2) - (3)].val.opval), (ps[(3) - (3)].val.opval)),
newMETHOP(OP_METHOD, 0, (ps[(1) - (3)].val.opval))));
- }
+ ;}
break;
case 112:
op_append_elem(OP_LIST,
op_prepend_elem(OP_LIST, (ps[(2) - (5)].val.opval), (ps[(4) - (5)].val.opval)),
newMETHOP(OP_METHOD, 0, (ps[(1) - (5)].val.opval))));
- }
+ ;}
break;
case 113:
#line 719 "perly.y"
- { (yyval.opval) = op_convert_list((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = op_convert_list((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); ;}
break;
case 114:
#line 721 "perly.y"
- { (yyval.opval) = op_convert_list((ps[(1) - (4)].val.ival), 0, (ps[(3) - (4)].val.opval)); }
+ { (yyval.opval) = op_convert_list((ps[(1) - (4)].val.ival), 0, (ps[(3) - (4)].val.opval)); ;}
break;
case 115:
#line 723 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
- (yyval.opval) = newANONATTRSUB((ps[(2) - (3)].val.ival), 0, (OP*)NULL, (ps[(3) - (3)].val.opval)); }
+ (yyval.opval) = newANONATTRSUB((ps[(2) - (3)].val.ival), 0, (OP*)NULL, (ps[(3) - (3)].val.opval)); ;}
break;
case 116:
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST,
op_prepend_elem(OP_LIST, (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)), (ps[(1) - (5)].val.opval)));
- }
+ ;}
break;
case 119:
#line 741 "perly.y"
- { (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[(1) - (5)].val.opval), scalar((ps[(3) - (5)].val.opval))); }
+ { (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[(1) - (5)].val.opval), scalar((ps[(3) - (5)].val.opval))); ;}
break;
case 120:
#line 743 "perly.y"
{ (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((ps[(1) - (4)].val.opval)), scalar((ps[(3) - (4)].val.opval)));
- }
+ ;}
break;
case 121:
{ (yyval.opval) = newBINOP(OP_AELEM, 0,
ref(newAVREF((ps[(1) - (5)].val.opval)),OP_RV2AV),
scalar((ps[(4) - (5)].val.opval)));
- }
+ ;}
break;
case 122:
{ (yyval.opval) = newBINOP(OP_AELEM, 0,
ref(newAVREF((ps[(1) - (4)].val.opval)),OP_RV2AV),
scalar((ps[(3) - (4)].val.opval)));
- }
+ ;}
break;
case 123:
#line 756 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[(1) - (5)].val.opval)), jmaybe((ps[(3) - (5)].val.opval)));
- }
+ ;}
break;
case 124:
#line 759 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV),
- jmaybe((ps[(4) - (6)].val.opval))); }
+ jmaybe((ps[(4) - (6)].val.opval))); ;}
break;
case 125:
#line 763 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV),
- jmaybe((ps[(3) - (5)].val.opval))); }
+ jmaybe((ps[(3) - (5)].val.opval))); ;}
break;
case 126:
#line 767 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
- newCVREF(0, scalar((ps[(1) - (4)].val.opval)))); }
+ newCVREF(0, scalar((ps[(1) - (4)].val.opval)))); ;}
break;
case 127:
#line 770 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, (ps[(4) - (5)].val.opval),
- newCVREF(0, scalar((ps[(1) - (5)].val.opval))))); }
+ newCVREF(0, scalar((ps[(1) - (5)].val.opval))))); ;}
break;
case 128:
#line 775 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, (ps[(3) - (4)].val.opval),
- newCVREF(0, scalar((ps[(1) - (4)].val.opval))))); }
+ newCVREF(0, scalar((ps[(1) - (4)].val.opval))))); ;}
break;
case 129:
#line 779 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
- newCVREF(0, scalar((ps[(1) - (3)].val.opval)))); }
+ newCVREF(0, scalar((ps[(1) - (3)].val.opval)))); ;}
break;
case 130:
#line 782 "perly.y"
- { (yyval.opval) = newSLICEOP(0, (ps[(5) - (6)].val.opval), (ps[(2) - (6)].val.opval)); }
+ { (yyval.opval) = newSLICEOP(0, (ps[(5) - (6)].val.opval), (ps[(2) - (6)].val.opval)); ;}
break;
case 131:
#line 784 "perly.y"
- { (yyval.opval) = newSLICEOP(0, (ps[(3) - (4)].val.opval), (ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newSLICEOP(0, (ps[(3) - (4)].val.opval), (ps[(1) - (4)].val.opval)); ;}
break;
case 132:
#line 786 "perly.y"
- { (yyval.opval) = newSLICEOP(0, (ps[(4) - (5)].val.opval), (OP*)NULL); }
+ { (yyval.opval) = newSLICEOP(0, (ps[(4) - (5)].val.opval), (OP*)NULL); ;}
break;
case 133:
#line 791 "perly.y"
- { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[(1) - (3)].val.opval), (ps[(2) - (3)].val.ival), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[(1) - (3)].val.opval), (ps[(2) - (3)].val.ival), (ps[(3) - (3)].val.opval)); ;}
break;
case 134:
#line 793 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 135:
{ if ((ps[(2) - (3)].val.ival) != OP_REPEAT)
scalar((ps[(1) - (3)].val.opval));
(yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, (ps[(1) - (3)].val.opval), scalar((ps[(3) - (3)].val.opval)));
- }
+ ;}
break;
case 136:
#line 800 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 137:
#line 802 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 138:
#line 804 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 139:
#line 806 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 140:
#line 808 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 141:
#line 810 "perly.y"
- { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newBINOP((ps[(2) - (3)].val.ival), 0, scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 142:
#line 812 "perly.y"
- { (yyval.opval) = newRANGE((ps[(2) - (3)].val.ival), scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); }
+ { (yyval.opval) = newRANGE((ps[(2) - (3)].val.ival), scalar((ps[(1) - (3)].val.opval)), scalar((ps[(3) - (3)].val.opval))); ;}
break;
case 143:
#line 814 "perly.y"
- { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 144:
#line 816 "perly.y"
- { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 145:
#line 818 "perly.y"
- { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 146:
#line 820 "perly.y"
- { (yyval.opval) = bind_match((ps[(2) - (3)].val.ival), (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = bind_match((ps[(2) - (3)].val.ival), (ps[(1) - (3)].val.opval), (ps[(3) - (3)].val.opval)); ;}
break;
case 147:
#line 825 "perly.y"
- { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[(2) - (2)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[(2) - (2)].val.opval))); ;}
break;
case 148:
#line 827 "perly.y"
- { (yyval.opval) = (ps[(2) - (2)].val.opval); }
+ { (yyval.opval) = (ps[(2) - (2)].val.opval); ;}
break;
case 149:
#line 830 "perly.y"
- { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); ;}
break;
case 150:
#line 832 "perly.y"
- { (yyval.opval) = newUNOP(OP_COMPLEMENT, 0, scalar((ps[(2) - (2)].val.opval))); }
+ { (yyval.opval) = newUNOP((ps[(1) - (2)].val.ival), 0, scalar((ps[(2) - (2)].val.opval))); ;}
break;
case 151:
#line 834 "perly.y"
{ (yyval.opval) = newUNOP(OP_POSTINC, 0,
- op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTINC)); }
+ op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTINC)); ;}
break;
case 152:
#line 837 "perly.y"
{ (yyval.opval) = newUNOP(OP_POSTDEC, 0,
- op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTDEC));}
+ op_lvalue(scalar((ps[(1) - (2)].val.opval)), OP_POSTDEC));;}
break;
case 153:
)),
(ps[(1) - (2)].val.opval)
));
- }
+ ;}
break;
case 154:
#line 851 "perly.y"
{ (yyval.opval) = newUNOP(OP_PREINC, 0,
- op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREINC)); }
+ op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREINC)); ;}
break;
case 155:
#line 854 "perly.y"
{ (yyval.opval) = newUNOP(OP_PREDEC, 0,
- op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREDEC)); }
+ op_lvalue(scalar((ps[(2) - (2)].val.opval)), OP_PREDEC)); ;}
break;
case 156:
#line 861 "perly.y"
- { (yyval.opval) = newANONLIST((ps[(2) - (3)].val.opval)); }
+ { (yyval.opval) = newANONLIST((ps[(2) - (3)].val.opval)); ;}
break;
case 157:
#line 863 "perly.y"
- { (yyval.opval) = newANONLIST((OP*)NULL);}
+ { (yyval.opval) = newANONLIST((OP*)NULL);;}
break;
case 158:
#line 865 "perly.y"
- { (yyval.opval) = newANONHASH((ps[(2) - (4)].val.opval)); }
+ { (yyval.opval) = newANONHASH((ps[(2) - (4)].val.opval)); ;}
break;
case 159:
#line 867 "perly.y"
- { (yyval.opval) = newANONHASH((OP*)NULL); }
+ { (yyval.opval) = newANONHASH((OP*)NULL); ;}
break;
case 160:
#line 869 "perly.y"
{ SvREFCNT_inc_simple_void(PL_compcv);
- (yyval.opval) = newANONATTRSUB((ps[(2) - (5)].val.ival), (ps[(3) - (5)].val.opval), (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)); }
+ (yyval.opval) = newANONATTRSUB((ps[(2) - (5)].val.ival), (ps[(3) - (5)].val.opval), (ps[(4) - (5)].val.opval), (ps[(5) - (5)].val.opval)); ;}
break;
case 161:
op_append_list(OP_LINESEQ, (ps[(4) - (8)].val.opval), (ps[(7) - (8)].val.opval)));
SvREFCNT_inc_simple_void(PL_compcv);
(yyval.opval) = newANONATTRSUB((ps[(2) - (8)].val.ival), NULL, (ps[(5) - (8)].val.opval), body);
- }
+ ;}
break;
case 162:
#line 886 "perly.y"
- { (yyval.opval) = dofile((ps[(2) - (2)].val.opval), (ps[(1) - (2)].val.ival));}
+ { (yyval.opval) = dofile((ps[(2) - (2)].val.opval), (ps[(1) - (2)].val.ival));;}
break;
case 163:
#line 888 "perly.y"
- { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[(2) - (2)].val.opval)));}
+ { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[(2) - (2)].val.opval)));;}
break;
case 168:
#line 896 "perly.y"
- { (yyval.opval) = newCONDOP(0, (ps[(1) - (5)].val.opval), (ps[(3) - (5)].val.opval), (ps[(5) - (5)].val.opval)); }
+ { (yyval.opval) = newCONDOP(0, (ps[(1) - (5)].val.opval), (ps[(3) - (5)].val.opval), (ps[(5) - (5)].val.opval)); ;}
break;
case 169:
#line 898 "perly.y"
- { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[(2) - (2)].val.opval)); ;}
break;
case 170:
#line 900 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 171:
#line 902 "perly.y"
- { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - (2)].val.ival)); }
+ { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - (2)].val.ival)); ;}
break;
case 172:
#line 904 "perly.y"
- { (yyval.opval) = sawparens((ps[(2) - (3)].val.opval)); }
+ { (yyval.opval) = sawparens((ps[(2) - (3)].val.opval)); ;}
break;
case 173:
#line 906 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 174:
#line 908 "perly.y"
- { (yyval.opval) = sawparens(newNULLLIST()); }
+ { (yyval.opval) = sawparens(newNULLLIST()); ;}
break;
case 175:
#line 910 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 176:
#line 912 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 177:
#line 914 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 178:
#line 916 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 179:
#line 918 "perly.y"
- { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));}
+ { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[(1) - (1)].val.opval), OP_AV2ARYLEN));;}
break;
case 180:
#line 920 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 181:
if ((yyval.opval) && (ps[(1) - (4)].val.opval))
(yyval.opval)->op_private |=
(ps[(1) - (4)].val.opval)->op_private & OPpSLICEWARNING;
- }
+ ;}
break;
case 182:
if ((yyval.opval) && (ps[(1) - (4)].val.opval))
(yyval.opval)->op_private |=
(ps[(1) - (4)].val.opval)->op_private & OPpSLICEWARNING;
- }
+ ;}
break;
case 183:
if ((yyval.opval) && (ps[(1) - (5)].val.opval))
(yyval.opval)->op_private |=
(ps[(1) - (5)].val.opval)->op_private & OPpSLICEWARNING;
- }
+ ;}
break;
case 184:
if ((yyval.opval) && (ps[(1) - (5)].val.opval))
(yyval.opval)->op_private |=
(ps[(1) - (5)].val.opval)->op_private & OPpSLICEWARNING;
- }
+ ;}
break;
case 185:
#line 962 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 186:
#line 964 "perly.y"
- { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 187:
#line 966 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (3)].val.opval)));
- }
+ ;}
break;
case 188:
{
(yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, (ps[(3) - (4)].val.opval), scalar((ps[(1) - (4)].val.opval))));
- }
+ ;}
break;
case 189:
#line 974 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, (ps[(3) - (3)].val.opval), scalar((ps[(2) - (3)].val.opval))));
- }
+ ;}
break;
case 190:
#line 978 "perly.y"
- { (yyval.opval) = newSVREF((ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newSVREF((ps[(1) - (4)].val.opval)); ;}
break;
case 191:
#line 980 "perly.y"
- { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); ;}
break;
case 192:
#line 982 "perly.y"
- { (yyval.opval) = newHVREF((ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newHVREF((ps[(1) - (4)].val.opval)); ;}
break;
case 193:
#line 984 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, 0,
- scalar(newCVREF((ps[(3) - (4)].val.ival),(ps[(1) - (4)].val.opval)))); }
+ scalar(newCVREF((ps[(3) - (4)].val.ival),(ps[(1) - (4)].val.opval)))); ;}
break;
case 194:
#line 987 "perly.y"
- { (yyval.opval) = newGVREF(0,(ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newGVREF(0,(ps[(1) - (4)].val.opval)); ;}
break;
case 195:
#line 989 "perly.y"
{ (yyval.opval) = newOP((ps[(1) - (1)].val.ival), OPf_SPECIAL);
- PL_hints |= HINT_BLOCK_SCOPE; }
+ PL_hints |= HINT_BLOCK_SCOPE; ;}
break;
case 196:
#line 992 "perly.y"
- { (yyval.opval) = newLOOPEX((ps[(1) - (2)].val.ival),(ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newLOOPEX((ps[(1) - (2)].val.ival),(ps[(2) - (2)].val.opval)); ;}
break;
case 197:
#line 994 "perly.y"
- { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[(2) - (2)].val.opval))); ;}
break;
case 198:
#line 996 "perly.y"
- { (yyval.opval) = newOP((ps[(1) - (1)].val.ival), 0); }
+ { (yyval.opval) = newOP((ps[(1) - (1)].val.ival), 0); ;}
break;
case 199:
#line 998 "perly.y"
- { (yyval.opval) = newUNOP((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newUNOP((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); ;}
break;
case 200:
#line 1000 "perly.y"
- { (yyval.opval) = newUNOP((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newUNOP((ps[(1) - (2)].val.ival), 0, (ps[(2) - (2)].val.opval)); ;}
break;
case 201:
#line 1002 "perly.y"
- { (yyval.opval) = newOP(OP_REQUIRE, (ps[(1) - (1)].val.ival) ? OPf_SPECIAL : 0); }
+ { (yyval.opval) = newOP(OP_REQUIRE, (ps[(1) - (1)].val.ival) ? OPf_SPECIAL : 0); ;}
break;
case 202:
#line 1004 "perly.y"
- { (yyval.opval) = newUNOP(OP_REQUIRE, (ps[(1) - (2)].val.ival) ? OPf_SPECIAL : 0, (ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newUNOP(OP_REQUIRE, (ps[(1) - (2)].val.ival) ? OPf_SPECIAL : 0, (ps[(2) - (2)].val.opval)); ;}
break;
case 203:
#line 1006 "perly.y"
- { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 204:
#line 1008 "perly.y"
{ (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
- op_append_elem(OP_LIST, (ps[(2) - (2)].val.opval), scalar((ps[(1) - (2)].val.opval)))); }
+ op_append_elem(OP_LIST, (ps[(2) - (2)].val.opval), scalar((ps[(1) - (2)].val.opval)))); ;}
break;
case 205:
#line 1011 "perly.y"
- { (yyval.opval) = newOP((ps[(1) - (1)].val.ival), 0); }
+ { (yyval.opval) = newOP((ps[(1) - (1)].val.ival), 0); ;}
break;
case 206:
#line 1013 "perly.y"
- { (yyval.opval) = newOP((ps[(1) - (3)].val.ival), 0);}
+ { (yyval.opval) = newOP((ps[(1) - (3)].val.ival), 0);;}
break;
case 207:
#line 1015 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 208:
#line 1017 "perly.y"
- { (yyval.opval) = (ps[(1) - (3)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (3)].val.opval); ;}
break;
case 209:
#line 1019 "perly.y"
- { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); }
+ { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[(1) - (1)].val.opval))); ;}
break;
case 210:
#line 1021 "perly.y"
{ (yyval.opval) = ((ps[(1) - (3)].val.ival) == OP_NOT)
? newUNOP((ps[(1) - (3)].val.ival), 0, newSVOP(OP_CONST, 0, newSViv(0)))
- : newOP((ps[(1) - (3)].val.ival), OPf_SPECIAL); }
+ : newOP((ps[(1) - (3)].val.ival), OPf_SPECIAL); ;}
break;
case 211:
#line 1025 "perly.y"
- { (yyval.opval) = newUNOP((ps[(1) - (4)].val.ival), 0, (ps[(3) - (4)].val.opval)); }
+ { (yyval.opval) = newUNOP((ps[(1) - (4)].val.ival), 0, (ps[(3) - (4)].val.opval)); ;}
break;
case 212:
SAVEFREESV(PL_compcv);
} else
(yyval.ival) = 0;
- }
+ ;}
break;
case 213:
#line 1038 "perly.y"
- { (yyval.opval) = pmruntime((ps[(1) - (6)].val.opval), (ps[(4) - (6)].val.opval), (ps[(5) - (6)].val.opval), 1, (ps[(2) - (6)].val.ival)); }
+ { (yyval.opval) = pmruntime((ps[(1) - (6)].val.opval), (ps[(4) - (6)].val.opval), (ps[(5) - (6)].val.opval), 1, (ps[(2) - (6)].val.ival)); ;}
break;
case 216:
{
(yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
- }
+ ;}
break;
case 218:
#line 1051 "perly.y"
- { (yyval.opval) = my_attrs((ps[(2) - (3)].val.opval),(ps[(3) - (3)].val.opval)); }
+ { (yyval.opval) = my_attrs((ps[(2) - (3)].val.opval),(ps[(3) - (3)].val.opval)); ;}
break;
case 219:
#line 1053 "perly.y"
- { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - (2)].val.ival)); }
+ { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - (2)].val.ival)); ;}
break;
case 220:
#line 1058 "perly.y"
- { (yyval.opval) = sawparens((ps[(2) - (3)].val.opval)); }
+ { (yyval.opval) = sawparens((ps[(2) - (3)].val.opval)); ;}
break;
case 221:
#line 1060 "perly.y"
- { (yyval.opval) = sawparens(newNULLLIST()); }
+ { (yyval.opval) = sawparens(newNULLLIST()); ;}
break;
case 222:
#line 1063 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 223:
#line 1065 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 224:
#line 1067 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 225:
#line 1072 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 226:
#line 1074 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 227:
#line 1078 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 228:
#line 1080 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
case 229:
#line 1084 "perly.y"
- { (yyval.opval) = (OP*)NULL; }
+ { (yyval.opval) = (OP*)NULL; ;}
break;
case 230:
#line 1086 "perly.y"
- { (yyval.opval) = (ps[(2) - (2)].val.opval); }
+ { (yyval.opval) = (ps[(2) - (2)].val.opval); ;}
break;
case 231:
#line 1092 "perly.y"
- { parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); }
+ { parser->in_my = 0; (yyval.opval) = my((ps[(1) - (1)].val.opval)); ;}
break;
case 237:
#line 1105 "perly.y"
- { (yyval.opval) = newCVREF((ps[(1) - (2)].val.ival),(ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newCVREF((ps[(1) - (2)].val.ival),(ps[(2) - (2)].val.opval)); ;}
break;
case 238:
#line 1109 "perly.y"
- { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newSVREF((ps[(2) - (2)].val.opval)); ;}
break;
case 239:
#line 1113 "perly.y"
{ (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval));
if ((yyval.opval)) (yyval.opval)->op_private |= (ps[(1) - (2)].val.ival);
- }
+ ;}
break;
case 240:
#line 1119 "perly.y"
{ (yyval.opval) = newHVREF((ps[(2) - (2)].val.opval));
if ((yyval.opval)) (yyval.opval)->op_private |= (ps[(1) - (2)].val.ival);
- }
+ ;}
break;
case 241:
#line 1125 "perly.y"
- { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newAVREF((ps[(2) - (2)].val.opval)); ;}
break;
case 242:
#line 1127 "perly.y"
- { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); }
+ { (yyval.opval) = newAVREF((ps[(1) - (4)].val.opval)); ;}
break;
case 243:
#line 1131 "perly.y"
- { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); }
+ { (yyval.opval) = newGVREF(0,(ps[(2) - (2)].val.opval)); ;}
break;
case 245:
#line 1136 "perly.y"
- { (yyval.opval) = newAVREF((ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newAVREF((ps[(1) - (3)].val.opval)); ;}
break;
case 247:
#line 1141 "perly.y"
- { (yyval.opval) = newHVREF((ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newHVREF((ps[(1) - (3)].val.opval)); ;}
break;
case 249:
#line 1146 "perly.y"
- { (yyval.opval) = newGVREF(0,(ps[(1) - (3)].val.opval)); }
+ { (yyval.opval) = newGVREF(0,(ps[(1) - (3)].val.opval)); ;}
break;
case 250:
#line 1151 "perly.y"
- { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); }
+ { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;}
break;
case 251:
#line 1153 "perly.y"
- { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); }
+ { (yyval.opval) = scalar((ps[(1) - (1)].val.opval)); ;}
break;
case 252:
#line 1155 "perly.y"
- { (yyval.opval) = op_scope((ps[(1) - (1)].val.opval)); }
+ { (yyval.opval) = op_scope((ps[(1) - (1)].val.opval)); ;}
break;
case 253:
#line 1158 "perly.y"
- { (yyval.opval) = (ps[(1) - (1)].val.opval); }
+ { (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
+
+/* Line 1267 of yacc.c. */
+
default: break;
/* Generated from:
- * 12bc2d35e1af6b72fc94eb1621fe7f5c3e605bbacc097f6fd0e4598864ad9939 perly.y
+ * 0d7275f3d26eba5194cb04d866bf174da7b0efd786c93da356327709423460ee perly.y
* d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
* ex: set ro: */
*/
#ifdef PERL_CORE
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
+/* A Bison parser, made by GNU Bison 2.3. */
-/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int yydebug;
-#endif
-
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
ARROW = 337
};
#endif
-
/* Tokens. */
#define GRAMPROG 258
#define GRAMEXPR 259
#define ARROW 337
+
+
#ifdef PERL_IN_TOKE_C
static bool
S_is_opval_token(int type) {
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-/* Line 2053 of yacc.c */
-
I32 ival; /* __DEFAULT__ (marker for regen_perly.pl;
must always be 1st union member) */
char *pval;
OP *opval;
GV *gvval;
-
-
-/* Line 2053 of yacc.c */
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
+}
+/* Line 1529 of yacc.c. */
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
/* Generated from:
- * 12bc2d35e1af6b72fc94eb1621fe7f5c3e605bbacc097f6fd0e4598864ad9939 perly.y
+ * 0d7275f3d26eba5194cb04d866bf174da7b0efd786c93da356327709423460ee perly.y
* d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
* ex: set ro: */
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || 0
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
"ANDOP", "NOTOP", "','", "ASSIGNOP", "'?'", "':'", "DORDOR", "OROR",
"ANDAND", "BITOROP", "BITANDOP", "SHIFTOP", "MATCHOP", "'!'", "'~'",
"REFGEN", "UMINUS", "POWOP", "POSTJOIN", "POSTDEC", "POSTINC", "PREDEC",
- "PREINC", "ARROW", "')'", "'('", "'/'", "$accept", "grammar", "$@1",
- "$@2", "$@3", "$@4", "$@5", "$@6", "block", "formblock", "remember",
- "mblock", "mremember", "stmtseq", "formstmtseq", "fullstmt",
- "labfullstmt", "barestmt", "$@7", "$@8", "$@9", "$@10", "$@11", "@12",
- "$@13", "formline", "formarg", "sideff", "else", "cont", "mintro",
- "nexpr", "texpr", "iexpr", "mexpr", "mnexpr", "miexpr", "formname",
- "startsub", "startanonsub", "startformsub", "subname", "proto",
- "subattrlist", "myattrlist", "subsignature", "@14", "optsubbody", "expr",
- "listexpr", "listop", "@15", "method", "subscripted", "termbinop",
- "termunop", "anonymous", "termdo", "term", "@16", "myattrterm", "myterm",
- "optlistexpr", "optexpr", "optrepl", "my_scalar", "my_var",
- "refgen_topic", "amper", "scalar", "ary", "hsh", "arylen", "star",
- "sliceme", "kvslice", "gelem", "indirob", YY_NULL
+ "PREINC", "ARROW", "')'", "'('", "'/'", "$accept", "grammar", "@1", "@2",
+ "@3", "@4", "@5", "@6", "block", "formblock", "remember", "mblock",
+ "mremember", "stmtseq", "formstmtseq", "fullstmt", "labfullstmt",
+ "barestmt", "@7", "@8", "@9", "@10", "@11", "@12", "@13", "formline",
+ "formarg", "sideff", "else", "cont", "mintro", "nexpr", "texpr", "iexpr",
+ "mexpr", "mnexpr", "miexpr", "formname", "startsub", "startanonsub",
+ "startformsub", "subname", "proto", "subattrlist", "myattrlist",
+ "subsignature", "@14", "optsubbody", "expr", "listexpr", "listop", "@15",
+ "method", "subscripted", "termbinop", "termunop", "anonymous", "termdo",
+ "term", "@16", "myattrterm", "myterm", "optlistexpr", "optexpr",
+ "optrepl", "my_scalar", "my_var", "refgen_topic", "amper", "scalar",
+ "ary", "hsh", "arylen", "star", "sliceme", "kvslice", "gelem", "indirob", 0
};
#endif
1, 1, 1, 1
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -249
static const yytype_int16 yytable[] =
{
0, 184
};
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-419)))
-
-#define yytable_value_is_error(Yytable_value) \
- (!!((Yytable_value) == (-249)))
-
static const yytype_int16 yycheck[] =
{
15, 128, 308, 325, 9, 15, 48, 42, 48, 413,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival,
- toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval
+ toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
+ toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival, toketype_opval,
+ toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_ival,
+ toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval
};
/* Generated from:
- * 12bc2d35e1af6b72fc94eb1621fe7f5c3e605bbacc097f6fd0e4598864ad9939 perly.y
+ * 0d7275f3d26eba5194cb04d866bf174da7b0efd786c93da356327709423460ee perly.y
* d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
* ex: set ro: */
| '!' term /* !$x */
{ $$ = newUNOP(OP_NOT, 0, scalar($2)); }
| '~' term /* ~$x */
- { $$ = newUNOP(OP_COMPLEMENT, 0, scalar($2)); }
+ { $$ = newUNOP($1, 0, scalar($2)); }
| term POSTINC /* $x++ */
{ $$ = newUNOP(OP_POSTINC, 0,
op_lvalue(scalar($1), OP_POSTINC)); }
sub { 1 if die; }
-=item Possible precedence problem on bitwise %c operator
+=item Possible precedence problem on bitwise %s operator
(W precedence) Your program uses a bitwise logical operator in conjunction
with a numeric comparison operator, like this :
This is to prevent the problem of one module changing the array base out
from under another module inadvertently. See L<perlvar/$[> and L<arybase>.
+=item The bitwise feature is experimental
+
+(S experimental::bitwise) This warning is emitted if you use bitwise
+operators (C<& | ^ ~ &. |. ^. ~.>) with the "bitwise" feature enabled.
+Simply suppress the warning if you want to use the feature, but know
+that in doing so you are taking the risk of using an experimental
+feature which may change or be removed in a future Perl version:
+
+ no warnings "experimental::bitwise";
+ use feature "bitwise";
+ $x |.= $y;
+
=item The crypt() function is unimplemented due to excessive paranoia.
(F) Configure couldn't find the crypt() function on your machine,
See also: L<perlsub/Constant Functions>
+=item String- and number-specific bitwise operators
+
+Introduced in: Perl 5.22.0
+
+See also: L<perlop/Bitwise String Operators>
+
+Using this feature triggers warnings in the category
+C<experimental::bitwise>.
+
+The ticket for this feature is
+L<[perl #123466]|https://rt.perl.org/rt3/Ticket/Display.html?id=123466>.
+
+XXX #123466 is the ticket proposing the feature, not the "[EXPERIMENT]"
+ticket to track the implemented feature. The latter does not exist yet.
+
=item The <:win32> IO pseudolayer
The ticket for this feature is
architecture. So for example, C<~"\x{3B1}"> is C<"\x{FFFF_FC4E}"> on
32-bit machines and C<"\x{FFFF_FFFF_FFFF_FC4E}"> on 64-bit machines.
+If the experimental "bitwise" feature is enabled via C<use feature
+'bitwise'>, then unary "~" always treats its argument as a number, and an
+alternate form of the operator, "~.", always treats its argument as a
+string. So C<~0> and C<~"0"> will both give 2**32-1 on 32-bit platforms,
+whereas C<~.0> and C<~."0"> will both yield C<"\xff">. This feature
+produces a warning unless you use C<no warnings 'experimental::bitwise'>.
+
Unary "+" has no effect whatsoever, even on strings. It is useful
syntactically for separating a function name from a parenthesized expression
that would otherwise be interpreted as the complete list of function
print "Even\n" if ($x & 1) == 0;
+If the experimental "bitwise" feature is enabled via C<use feature
+'bitwise'>, then this operator always treats its operand as numbers. This
+feature produces a warning unless you use C<no warnings
+'experimental::bitwise'>.
+
=head2 Bitwise Or and Exclusive Or
X<operator, bitwise, or> X<bitwise or> X<|> X<operator, bitwise, xor>
X<bitwise xor> X<^>
print "false\n" if (8 | 2) != 10;
+If the experimental "bitwise" feature is enabled via C<use feature
+'bitwise'>, then this operator always treats its operand as numbers. This
+feature produces a warning unless you use C<no warnings
+'experimental::bitwise'>.
+
=head2 C-style Logical And
X<&&> X<logical and> X<operator, logical, and>
=head2 Assignment Operators
X<assignment> X<operator, assignment> X<=> X<**=> X<+=> X<*=> X<&=>
X<<< <<= >>> X<&&=> X<-=> X</=> X<|=> X<<< >>= >>> X<||=> X<//=> X<.=>
-X<%=> X<^=> X<x=>
+X<%=> X<^=> X<x=> X<&.=> X<|.=> X<^.=>
"=" is the ordinary assignment operator.
might trigger, such as from tie(). Other assignment operators work similarly.
The following are recognized:
- **= += *= &= <<= &&=
- -= /= |= >>= ||=
- .= %= ^= //=
+ **= += *= &= &.= <<= &&=
+ -= /= |= |.= >>= ||=
+ .= %= ^= ^.= //=
x=
Although these are grouped by family, they all have the precedence
the number of elements produced by the expression on the right hand
side of the assignment.
+The three dotted bitwise assignment operators (C<&.= |.= ^.=>) are new in
+Perl 5.22 and experimental. See L</Bitwise String Operators>.
+
=head2 Comma Operator
X<comma> X<operator, comma> X<,>
1 while foo();
=head2 Bitwise String Operators
-X<operator, bitwise, string>
+X<operator, bitwise, string> X<&.> X<|.> X<^.> X<~.>
Bitstrings of any size may be manipulated by the bitwise operators
(C<~ | & ^>).
$baz = 0+$foo & 0+$bar; # both ops explicitly numeric
$biz = "$foo" ^ "$bar"; # both ops explicitly stringy
+This somewhat unpredictable behavior can be avoided with the experimental
+"bitwise" feature, new in Perl 5.22. You can enable it via C<use feature
+'bitwise'>. By default, it will warn unless the "experimental::bitwise"
+warnings category has been disabled. (C<use experimental 'bitwise'> will
+enable the feature and disable the warning.) Under this feature, the four
+standard bitwise operators (C<~ | & ^>) are always numeric. Adding a dot
+after each operator (C<~. |. &. ^.>) forces it to treat its operands as
+strings:
+
+ use experimental "bitwise";
+ $foo = 150 | 105; # yields 255 (0x96 | 0x69 is 0xFF)
+ $foo = '150' | 105; # yields 255
+ $foo = 150 | '105'; # yields 255
+ $foo = '150' | '105'; # yields 255
+ $foo = 150 |. 105; # yields string '155' (under ASCII)
+ $foo = '150' |. 105; # yields string '155'
+ $foo = 150 |.'105'; # yields string '155'
+ $foo = '150' |.'105'; # yields string '155'
+
+ $baz = $foo & $bar; # both operands numeric
+ $biz = $foo ^. $bar; # both operands stringy
+
+The assignment variants of these operators (C<&= |= ^= &.= |.= ^.=>)
+behave likewise under the feature.
+
See L<perlfunc/vec> for information on how to manipulate individual bits
in a bit vector.
}
}
+PP(pp_nbit_and)
+{
+ dSP;
+ tryAMAGICbin_MG(band_amg, AMGf_assign|AMGf_numarg);
+ {
+ dATARGET; dPOPTOPssrl;
+ if (PL_op->op_private & HINT_INTEGER) {
+ const IV i = SvIV_nomg(left) & SvIV_nomg(right);
+ SETi(i);
+ }
+ else {
+ const UV u = SvUV_nomg(left) & SvUV_nomg(right);
+ SETu(u);
+ }
+ }
+ RETURN;
+}
+
+PP(pp_sbit_and)
+{
+ dSP;
+ tryAMAGICbin_MG(sband_amg, AMGf_assign);
+ {
+ dATARGET; dPOPTOPssrl;
+ do_vop(OP_BIT_AND, TARG, left, right);
+ RETSETTARG;
+ }
+}
/* also used for: pp_bit_xor() */
}
}
+/* also used for: pp_nbit_xor() */
+
+PP(pp_nbit_or)
+{
+ dSP;
+ const int op_type = PL_op->op_type;
+
+ tryAMAGICbin_MG((op_type == OP_NBIT_OR ? bor_amg : bxor_amg),
+ AMGf_assign|AMGf_numarg);
+ {
+ dATARGET; dPOPTOPssrl;
+ if (PL_op->op_private & HINT_INTEGER) {
+ const IV l = (USE_LEFT(left) ? SvIV_nomg(left) : 0);
+ const IV r = SvIV_nomg(right);
+ const IV result = op_type == OP_NBIT_OR ? (l | r) : (l ^ r);
+ SETi(result);
+ }
+ else {
+ const UV l = (USE_LEFT(left) ? SvUV_nomg(left) : 0);
+ const UV r = SvUV_nomg(right);
+ const UV result = op_type == OP_NBIT_OR ? (l | r) : (l ^ r);
+ SETu(result);
+ }
+ }
+ RETURN;
+}
+
+/* also used for: pp_sbit_xor() */
+
+PP(pp_sbit_or)
+{
+ dSP;
+ const int op_type = PL_op->op_type;
+
+ tryAMAGICbin_MG((op_type == OP_SBIT_OR ? sbor_amg : sbxor_amg),
+ AMGf_assign);
+ {
+ dATARGET; dPOPTOPssrl;
+ do_vop(op_type == OP_SBIT_OR ? OP_BIT_OR : OP_BIT_XOR, TARG, left,
+ right);
+ RETSETTARG;
+ }
+}
+
PERL_STATIC_INLINE bool
S_negate_string(pTHX)
{
return NORMAL;
}
-PP(pp_complement)
+static void
+S_scomplement(pTHX_ SV *targ, SV *sv)
{
- dSP; dTARGET;
- tryAMAGICun_MG(compl_amg, AMGf_numeric);
- {
- dTOPss;
- if (SvNIOKp(sv)) {
- if (PL_op->op_private & HINT_INTEGER) {
- const IV i = ~SvIV_nomg(sv);
- SETi(i);
- }
- else {
- const UV u = ~SvUV_nomg(sv);
- SETu(u);
- }
- }
- else {
U8 *tmps;
I32 anum;
STRLEN len;
sv_usepvn_flags(TARG, (char*)result, nchar, SV_HAS_TRAILING_NUL);
SvUTF8_off(TARG);
}
- SETTARG;
- return NORMAL;
+ return;
}
#ifdef LIBERAL
{
#endif
for ( ; anum > 0; anum--, tmps++)
*tmps = ~*tmps;
+}
+
+PP(pp_complement)
+{
+ dSP; dTARGET;
+ tryAMAGICun_MG(compl_amg, AMGf_numeric);
+ {
+ dTOPss;
+ if (SvNIOKp(sv)) {
+ if (PL_op->op_private & HINT_INTEGER) {
+ const IV i = ~SvIV_nomg(sv);
+ SETi(i);
+ }
+ else {
+ const UV u = ~SvUV_nomg(sv);
+ SETu(u);
+ }
+ }
+ else {
+ S_scomplement(aTHX_ TARG, sv);
SETTARG;
}
return NORMAL;
}
}
+PP(pp_ncomplement)
+{
+ dSP;
+ tryAMAGICun_MG(compl_amg, AMGf_numeric|AMGf_numarg);
+ {
+ dTARGET; dTOPss;
+ if (PL_op->op_private & HINT_INTEGER) {
+ const IV i = ~SvIV_nomg(sv);
+ SETi(i);
+ }
+ else {
+ const UV u = ~SvUV_nomg(sv);
+ SETu(u);
+ }
+ }
+ return NORMAL;
+}
+
+PP(pp_scomplement)
+{
+ dSP;
+ tryAMAGICun_MG(scompl_amg, AMGf_numeric);
+ {
+ dTARGET; dTOPss;
+ S_scomplement(aTHX_ TARG, sv);
+ SETTARG;
+ return NORMAL;
+ }
+}
+
/* integer versions of some of the above */
PP(pp_i_multiply)
#define RETSETYES RETURNX(SETs(&PL_sv_yes))
#define RETSETNO RETURNX(SETs(&PL_sv_no))
#define RETSETUNDEF RETURNX(SETs(&PL_sv_undef))
+#define RETSETTARG STMT_START { SETTARG; RETURN; } STMT_END
#define ARGTARG PL_op->op_targ
#define AMGf_numeric 0x10 /* for Perl_try_amagic_bin */
#define AMGf_set 0x20 /* for Perl_try_amagic_bin */
#define AMGf_want_list 0x40
+#define AMGf_numarg 0x80
/* do SvGETMAGIC on the stack args before checking for overload */
return NORMAL;
}
-/* This is sometimes called directly by pp_coreargs and pp_grepstart. */
+/* This is sometimes called directly by pp_coreargs, pp_grepstart and
+ amagic_call. */
PP(pp_pushmark)
{
PUSHMARK(PL_stack_sp);
PERL_CALLCONV OP *Perl_pp_modulo(pTHX);
PERL_CALLCONV OP *Perl_pp_multideref(pTHX);
PERL_CALLCONV OP *Perl_pp_multiply(pTHX);
+PERL_CALLCONV OP *Perl_pp_nbit_and(pTHX);
+PERL_CALLCONV OP *Perl_pp_nbit_or(pTHX);
PERL_CALLCONV OP *Perl_pp_ncmp(pTHX);
+PERL_CALLCONV OP *Perl_pp_ncomplement(pTHX);
PERL_CALLCONV OP *Perl_pp_ne(pTHX);
PERL_CALLCONV OP *Perl_pp_negate(pTHX);
PERL_CALLCONV OP *Perl_pp_next(pTHX);
PERL_CALLCONV OP *Perl_pp_rv2gv(pTHX);
PERL_CALLCONV OP *Perl_pp_rv2sv(pTHX);
PERL_CALLCONV OP *Perl_pp_sassign(pTHX);
+PERL_CALLCONV OP *Perl_pp_sbit_and(pTHX);
+PERL_CALLCONV OP *Perl_pp_sbit_or(pTHX);
PERL_CALLCONV OP *Perl_pp_schop(pTHX);
PERL_CALLCONV OP *Perl_pp_scmp(pTHX);
+PERL_CALLCONV OP *Perl_pp_scomplement(pTHX);
PERL_CALLCONV OP *Perl_pp_seekdir(pTHX);
PERL_CALLCONV OP *Perl_pp_select(pTHX);
PERL_CALLCONV OP *Perl_pp_semctl(pTHX);
say => 'say',
state => 'state',
switch => 'switch',
+ bitwise => 'bitwise',
evalbytes => 'evalbytes',
postderef => 'postderef',
array_base => 'arybase',
__END__
package feature;
-our $VERSION = '1.39';
+our $VERSION = '1.40';
FEATURES
This feature is available from Perl 5.22 onwards.
+=head2 The 'bitwise' feature
+
+B<WARNING>: This feature is still experimental and the implementation may
+change in future versions of Perl. For this reason, Perl will
+warn when you use the feature, unless you have explicitly disabled the
+warning:
+
+ no warnings "experimental::bitwise";
+
+This makes the four standard bitwise operators (C<& | ^ ~>) treat their
+operands consistently as numbers, and introduces four new dotted operators
+(C<&. |. ^. ~.>) that treat their operands consistently as strings. The
+same applies to the assignment variants (C<&= |= ^= &.= |.= ^.=>).
+
+See L<perlop/Bitwise String Operators> for details.
+
+This feature is available from Perl 5.22 onwards.
+
=head1 FEATURE BUNDLES
It's possible to load multiple features together, using
Perl_pp_shift => ['pop'],
Perl_pp_sin => [qw(cos exp log sqrt)],
Perl_pp_bit_or => ['bit_xor'],
+ Perl_pp_nbit_or => ['nbit_xor'],
+ Perl_pp_sbit_or => ['sbit_xor'],
Perl_pp_rv2av => ['rv2hv'],
Perl_pp_akeys => ['avalues'],
Perl_pp_rkeys => [qw(rvalues reach)],
my %OP_IS_FT_ACCESS; # /F-+/
my %OP_IS_NUMCOMPARE; # /S</
my %OP_IS_DIRHOP; # /Fd/
+my %OP_IS_INFIX_BIT; # /S\|/
my $OCSHIFT = 8;
my $OASHIFT = 12;
$OP_IS_FILETEST{$op} = $opnum{$op} if $arg =~ s/-//;
$OP_IS_FT_ACCESS{$op} = $opnum{$op} if $arg =~ s/\+//;
}
- elsif ($arg =~ /^S</) {
+ elsif ($arg =~ /^S./) {
$OP_IS_NUMCOMPARE{$op} = $opnum{$op} if $arg =~ s/<//;
+ $OP_IS_INFIX_BIT {$op} = $opnum{$op} if $arg =~ s/\|//;
}
my $argnum = ($arg =~ s/\?//) ? 8 : 0;
die "op = $op, arg = $arg\n"
gen_op_is_macro( \%OP_IS_FT_ACCESS, 'OP_IS_FILETEST_ACCESS');
gen_op_is_macro( \%OP_IS_NUMCOMPARE, 'OP_IS_NUMCOMPARE');
gen_op_is_macro( \%OP_IS_DIRHOP, 'OP_IS_DIRHOP');
+gen_op_is_macro( \%OP_IS_INFIX_BIT, 'OP_IS_INFIX_BIT');
sub gen_op_is_macro {
my ($op_is, $macname) = @_;
# scalar - S list - L array - A
# hash - H sub (CV) - C file - F
# socket - Fs filetest - F- filetest_access - F-+
-# num-compare - S< dirhandle - DF
+# num-compare - S< dirhandle - DF infix bitwise - S|
# reference - R
# "?" denotes an optional operand.
sne string ne ck_null ifs2 S S
scmp string comparison (cmp) ck_null ifsT2 S S
-bit_and bitwise and (&) ck_bitop fst2 S S
-bit_xor bitwise xor (^) ck_bitop fst2 S S
-bit_or bitwise or (|) ck_bitop fst2 S S
+bit_and bitwise and (&) ck_bitop fst2 S S|
+bit_xor bitwise xor (^) ck_bitop fst2 S S|
+bit_or bitwise or (|) ck_bitop fst2 S S|
+nbit_and numeric bitiwse and (&) ck_bitop fsT2 S S|
+nbit_xor numeric bitwise xor (^) ck_bitop fsT2 S S|
+nbit_or numeric bitwise or (|) ck_bitop fsT2 S S|
+sbit_and string bitiwse and (&) ck_bitop fst2 S S|
+sbit_xor string bitwise xor (^) ck_bitop fst2 S S|
+sbit_or string bitwise or (|) ck_bitop fst2 S S|
negate negation (-) ck_null Ifst1 S
i_negate integer negation (-) ck_null ifst1 S
not not ck_null ifs1 S
complement 1's complement (~) ck_bitop fsT1 S
+ncomplement numeric 1's complement (~) ck_bitop fsT1 S
+# scomplement uses ck_bitop only for the experimental warning. Once the
+# warning is gone, this can change to ck_null.
+scomplement string 1's complement (~) ck_bitop fsT1 S
smartmatch smart match ck_smartmatch s2
rshift_ass (>>=
band (&
band_ass (&=
+sband (&.
+sband_ass (&.=
bor (|
bor_ass (|=
+sbor (|.
+sbor_ass (|.=
bxor (^
bxor_ass (^=
+sbxor (^.
+sbxor_ass (^.=
ncmp (<=>
scmp (cmp
compl (~
+scompl (~.
atan2 (atan2
cos (cos
sin (sin
[ 5.021, DEFAULT_ON ],
'experimental::const_attr' =>
[ 5.021, DEFAULT_ON ],
+ 'experimental::bitwise' =>
+ [ 5.021, DEFAULT_ON ],
}],
'missing' => [ 5.021, DEFAULT_OFF],
Use of /g modifier is meaningless in split
+ The bitwise feature is experimental [Perl_ck_bitop]
+
Possible precedence problem on bitwise %c operator [Perl_ck_bitop]
Mandatory Warnings
EXPECT
Use of /g modifier is meaningless in split at - line 4.
########
+use feature "bitwise";
+$_ = $_ | $_;
+$_ = $_ & $_;
+$_ = $_ ^ $_;
+$_ = ~$_;
+$_ = $_ |. $_;
+$_ = $_ &. $_;
+$_ = $_ ^. $_;
+$_ = ~.$_;
+$_ |= $_;
+$_ &= $_;
+$_ ^= $_;
+$_ |.= $_;
+$_ &.= $_;
+$_ ^.= $_;
+use warnings "experimental::bitwise";
+$_ = $_ | $_;
+$_ = $_ & $_;
+$_ = $_ ^ $_;
+$_ = ~$_;
+$_ = $_ |. $_;
+$_ = $_ &. $_;
+$_ = $_ ^. $_;
+$_ = ~.$_;
+$_ |= $_;
+$_ &= $_;
+$_ ^= $_;
+$_ |.= $_;
+$_ &.= $_;
+$_ ^.= $_;
+no warnings "experimental::bitwise";
+$_ = $_ | $_;
+$_ = $_ & $_;
+$_ = $_ ^ $_;
+$_ = ~$_;
+$_ = $_ |. $_;
+$_ = $_ &. $_;
+$_ = $_ ^. $_;
+$_ = ~.$_;
+$_ |= $_;
+$_ &= $_;
+$_ ^= $_;
+$_ |.= $_;
+$_ &.= $_;
+$_ ^.= $_;
+EXPECT
+The bitwise feature is experimental at - line 2.
+The bitwise feature is experimental at - line 3.
+The bitwise feature is experimental at - line 4.
+The bitwise feature is experimental at - line 5.
+The bitwise feature is experimental at - line 6.
+The bitwise feature is experimental at - line 7.
+The bitwise feature is experimental at - line 8.
+The bitwise feature is experimental at - line 9.
+The bitwise feature is experimental at - line 10.
+The bitwise feature is experimental at - line 11.
+The bitwise feature is experimental at - line 12.
+The bitwise feature is experimental at - line 13.
+The bitwise feature is experimental at - line 14.
+The bitwise feature is experimental at - line 15.
+The bitwise feature is experimental at - line 17.
+The bitwise feature is experimental at - line 18.
+The bitwise feature is experimental at - line 19.
+The bitwise feature is experimental at - line 20.
+The bitwise feature is experimental at - line 21.
+The bitwise feature is experimental at - line 22.
+The bitwise feature is experimental at - line 23.
+The bitwise feature is experimental at - line 24.
+The bitwise feature is experimental at - line 25.
+The bitwise feature is experimental at - line 26.
+The bitwise feature is experimental at - line 27.
+The bitwise feature is experimental at - line 28.
+The bitwise feature is experimental at - line 29.
+The bitwise feature is experimental at - line 30.
+########
# op.c
use warnings 'precedence';
$a = $b & $c == $d;
$a = $b <= $c | $d;
$a = $b <=> $c & $d;
$a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
+{
+ use experimental 'bitwise';
+ $a = $b & $c == $d;
+ $a = $b ^ $c != $d;
+ $a = $b | $c > $d;
+ $a = $b < $c & $d;
+ $a = $b >= $c ^ $d;
+ $a = $b <= $c | $d;
+ $a = $b <=> $c & $d;
+ $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
+ $a = $b &. $c == $d;
+ $a = $b ^. $c != $d;
+ $a = $b |. $c > $d;
+ $a = $b < $c &. $d;
+ $a = $b >= $c ^. $d;
+ $a = $b <= $c |. $d;
+ $a = $b <=> $c &. $d;
+ $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
+}
no warnings 'precedence';
$a = $b & $c == $d;
$a = $b ^ $c != $d;
$a = $b >= $c ^ $d;
$a = $b <= $c | $d;
$a = $b <=> $c & $d;
+{
+ use experimental 'bitwise';
+ $a = $b & $c == $d;
+ $a = $b ^ $c != $d;
+ $a = $b | $c > $d;
+ $a = $b < $c & $d;
+ $a = $b >= $c ^ $d;
+ $a = $b <= $c | $d;
+ $a = $b <=> $c & $d;
+ $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
+ $a = $b &. $c == $d;
+ $a = $b ^. $c != $d;
+ $a = $b |. $c > $d;
+ $a = $b < $c &. $d;
+ $a = $b >= $c ^. $d;
+ $a = $b <= $c |. $d;
+ $a = $b <=> $c &. $d;
+ $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
+}
EXPECT
Possible precedence problem on bitwise & operator at - line 3.
Possible precedence problem on bitwise ^ operator at - line 4.
Possible precedence problem on bitwise ^ operator at - line 7.
Possible precedence problem on bitwise | operator at - line 8.
Possible precedence problem on bitwise & operator at - line 9.
+Possible precedence problem on bitwise & operator at - line 13.
+Possible precedence problem on bitwise ^ operator at - line 14.
+Possible precedence problem on bitwise | operator at - line 15.
+Possible precedence problem on bitwise & operator at - line 16.
+Possible precedence problem on bitwise ^ operator at - line 17.
+Possible precedence problem on bitwise | operator at - line 18.
+Possible precedence problem on bitwise & operator at - line 19.
+Possible precedence problem on bitwise &. operator at - line 21.
+Possible precedence problem on bitwise ^. operator at - line 22.
+Possible precedence problem on bitwise |. operator at - line 23.
+Possible precedence problem on bitwise &. operator at - line 24.
+Possible precedence problem on bitwise ^. operator at - line 25.
+Possible precedence problem on bitwise |. operator at - line 26.
+Possible precedence problem on bitwise &. operator at - line 27.
########
# op.c
use integer;
# If you find tests are failing, please try adding names to tests to track
# down where the failure is, and supply your new names as a patch.
# (Just-in-time test naming)
-plan tests => 174 + (10*13*2) + 5;
+plan tests => 194 + (10*13*2) + 5;
# numerics
ok ((0xdead & 0xbeef) == 0x9ead);
is(~~$str, $ref, "use bytes with long replacement");
}
+# New string- and number-specific bitwise ops
+{
+ use feature "bitwise";
+ no warnings "experimental::bitwise";
+ is "22" & "66", 2, 'numeric & with strings';
+ is "22" | "66", 86, 'numeric | with strings';
+ is "22" ^ "66", 84, 'numeric ^ with strings';
+ is ~"22" & 0xff, 233, 'numeric ~ with string';
+ is 22 &. 66, 22, '&. with numbers';
+ is 22 |. 66, 66, '|. with numbers';
+ is 22 ^. 66, "\4\4", '^. with numbers';
+ is ~.22, "\xcd\xcd", '~. with number';
+ $_ = "22";
+ is $_ &= "66", 2, 'numeric &= with strings';
+ $_ = "22";
+ is $_ |= "66", 86, 'numeric |= with strings';
+ $_ = "22";
+ is $_ ^= "66", 84, 'numeric ^= with strings';
+ $_ = 22;
+ is $_ &.= 66, 22, '&.= with numbers';
+ $_ = 22;
+ is $_ |.= 66, 66, '|.= with numbers';
+ $_ = 22;
+ is $_ ^.= 66, "\4\4", '^.= with numbers';
+
+ # signed vs. unsigned
+ ok ((~0 > 0 && do { use integer; ~0 } == -1));
+
+ my $bits = 0;
+ for (my $i = ~0; $i; $i >>= 1) { ++$bits; }
+ my $cusp = 1 << ($bits - 1);
+
+ ok (($cusp & -1) > 0 && do { use integer; $cusp & -1 } < 0);
+ ok (($cusp | 1) > 0 && do { use integer; $cusp | 1 } < 0);
+ ok (($cusp ^ 1) > 0 && do { use integer; $cusp ^ 1 } < 0);
+ ok ((1 << ($bits - 1)) == $cusp &&
+ do { use integer; 1 << ($bits - 1) } == -$cusp);
+ ok (($cusp >> 1) == ($cusp / 2) &&
+ do { use integer; abs($cusp >> 1) } == ($cusp / 2));
+}
+
# ref tests
my %res;
* FUN1 : not used, except for not, which isn't a UNIOP
* BOop : bitwise or or xor
* BAop : bitwise and
+ * BCop : bitwise complement
* SHop : shift operator
* PWop : power operator
* PMop : pattern-matching operator
#define FUN1(f) return (pl_yylval.ival=f, PL_expect=XOPERATOR, PL_bufptr=s, REPORT((int)FUNC1))
#define BOop(f) return ao((pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr=s, (int)BITOROP))
#define BAop(f) return ao((pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr=s, (int)BITANDOP))
+#define BCop(f) return pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr = s, \
+ REPORT('~')
#define SHop(f) return ao((pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr=s, (int)SHIFTOP))
#define PWop(f) return ao((pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr=s, (int)POWOP))
#define PMop(f) return(pl_yylval.ival=f, PL_expect=XTERM, PL_bufptr=s, REPORT((int)MATCHOP))
TERM('%');
}
case '^':
+ d = s;
+ bof = FEATURE_BITWISE_IS_ENABLED;
+ if (bof && s[1] == '.')
+ s++;
if (!PL_lex_allbrackets && PL_lex_fakeeof >=
(s[1] == '=' ? LEX_FAKEEOF_ASSIGN : LEX_FAKEEOF_BITWISE))
+ {
+ s = d;
TOKEN(0);
+ }
s++;
- BOop(OP_BIT_XOR);
+ BOop(bof ? d == s-2 ? OP_SBIT_XOR : OP_NBIT_XOR : OP_BIT_XOR);
case '[':
if (PL_lex_brackets > 100)
Renew(PL_lex_brackstack, PL_lex_brackets + 10, char);
Eop(OP_SMARTMATCH);
}
s++;
- OPERATOR('~');
+ if ((bof = FEATURE_BITWISE_IS_ENABLED) && *s == '.') {
+ s++;
+ BCop(OP_SCOMPLEMENT);
+ }
+ BCop(bof ? OP_NCOMPLEMENT : OP_COMPLEMENT);
case ',':
if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_COMMA)
TOKEN(0);
Perl_warner(aTHX_ packWARN(WARN_SEMICOLON), "%s", PL_warn_nosemi);
CopLINE_inc(PL_curcop);
}
+ d = s;
+ if ((bof = FEATURE_BITWISE_IS_ENABLED) && *s == '.')
+ s++;
if (!PL_lex_allbrackets && PL_lex_fakeeof >=
(*s == '=' ? LEX_FAKEEOF_ASSIGN : LEX_FAKEEOF_BITWISE)) {
+ s = d;
s--;
TOKEN(0);
}
- PL_parser->saw_infix_sigil = 1;
- BAop(OP_BIT_AND);
+ if (d == s) {
+ PL_parser->saw_infix_sigil = 1;
+ BAop(bof ? OP_NBIT_AND : OP_BIT_AND);
+ }
+ else
+ BAop(OP_SBIT_AND);
}
PL_tokenbuf[0] = '&';
AOPERATOR(OROR);
}
s--;
+ d = s;
+ if ((bof = FEATURE_BITWISE_IS_ENABLED) && *s == '.')
+ s++;
if (!PL_lex_allbrackets && PL_lex_fakeeof >=
(*s == '=' ? LEX_FAKEEOF_ASSIGN : LEX_FAKEEOF_BITWISE)) {
- s--;
+ s = d - 1;
TOKEN(0);
}
- BOop(OP_BIT_OR);
+ BOop(bof ? s == d ? OP_NBIT_OR : OP_SBIT_OR : OP_BIT_OR);
case '=':
s++;
{
/* Warnings Categories added in Perl 5.021 */
-#define WARN_EXPERIMENTAL__CONST_ATTR 60
-#define WARN_EXPERIMENTAL__RE_STRICT 61
-#define WARN_EXPERIMENTAL__REFALIASING 62
-#define WARN_EXPERIMENTAL__WIN32_PERLIO 63
-#define WARN_LOCALE 64
-#define WARN_MISSING 65
-#define WARN_REDUNDANT 66
+#define WARN_EXPERIMENTAL__BITWISE 60
+#define WARN_EXPERIMENTAL__CONST_ATTR 61
+#define WARN_EXPERIMENTAL__RE_STRICT 62
+#define WARN_EXPERIMENTAL__REFALIASING 63
+#define WARN_EXPERIMENTAL__WIN32_PERLIO 64
+#define WARN_LOCALE 65
+#define WARN_MISSING 66
+#define WARN_REDUNDANT 67
#define WARNsize 17
#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125"