From: Malcolm Beattie Date: Fri, 6 Feb 1998 15:04:17 +0000 (+0000) Subject: Some more Chip patches (tweaked to match _5x): X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69dcf70cb27ded45873eb396cabbcbd82a21a2c8;p=p5sagit%2Fp5-mst-13.2.git Some more Chip patches (tweaked to match _5x): Subject: [PATCH] Fix empty BLOCK Date: Wed, 4 Feb 1998 16:52:28 -0500 (EST) Subject: [PATCH] fix (\@@) proto Date: Thu, 5 Feb 1998 10:24:29 -0500 (EST) Subject: [PATCH] Cope with lack of args in Fcntl::AUTOLOAD Date: Thu, 5 Feb 1998 21:26:55 -0500 (EST) Subject: [PATCH] Don't fold string comparison under C Date: Thu, 5 Feb 1998 21:46:25 -0500 (EST) p4raw-id: //depot/perl@463 --- diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 6214323..74de3df 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -78,7 +78,7 @@ $VERSION = "1.03"; sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; - my $val = constant($constname, @_ ? $_[0] : 0); + my $val = constant($constname, (@_ && (caller(0))[4]) ? $_[0] : 0); if ($! != 0) { if ($! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; diff --git a/op.c b/op.c index 3cff0b2..90c604d 100644 --- a/op.c +++ b/op.c @@ -1645,6 +1645,12 @@ fold_constants(register OP *o) case OP_LCFIRST: case OP_UC: case OP_LC: + case OP_SLT: + case OP_SGT: + case OP_SLE: + case OP_SGE: + case OP_SCMP: + if (o->op_private & OPpLOCALE) goto nope; } @@ -4599,9 +4605,10 @@ ck_subr(OP *o) goto wrapref; { OP* kid = o2; - o2 = newUNOP(OP_RV2GV, 0, kid); - o2->op_sibling = kid->op_sibling; + OP* sib = kid->op_sibling; kid->op_sibling = 0; + o2 = newUNOP(OP_RV2GV, 0, kid); + o2->op_sibling = sib; prev->op_sibling = o; } goto wrapref; diff --git a/t/comp/proto.t b/t/comp/proto.t index d1cfede..080110b 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -362,17 +362,18 @@ printf "ok %d\n",$i++; ## ## -testing \&an_array_ref, '\@'; +testing \&array_ref_plus, '\@@'; -sub an_array_ref (\@) { +sub array_ref_plus (\@@) { print "# \@_ = (",join(",",@_),")\n"; - print "not " unless ref($_[0]) && 1 == @{$_[0]}; + print "not " unless @_ == 2 && ref($_[0]) && 1 == @{$_[0]} && $_[1] eq 'x'; printf "ok %d\n",$i++; @{$_[0]} = (qw(ok)," ",$i++,"\n"); } @array = ('a'); -an_array_ref @array; +{ my @more = ('x'); + array_ref_plus @array, @more; } print "not " unless @array == 4; print @array; diff --git a/toke.c b/toke.c index 51111d1..4547ad0 100644 --- a/toke.c +++ b/toke.c @@ -2014,8 +2014,13 @@ yylex(void) else lex_brackstack[lex_brackets++] = XOPERATOR; s = skipspace(s); - if (*s == '}') + if (*s == '}') { + if (expect == XSTATE) { + lex_brackstack[lex_brackets-1] = XSTATE; + break; + } OPERATOR(HASHBRACK); + } /* This hack serves to disambiguate a pair of curlies * as being a block or an anon hash. Normally, expectation * determines that, but in cases where we're not in a