This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Some more Chip patches (tweaked to match _5x):
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Fri, 6 Feb 1998 15:04:17 +0000 (15:04 +0000)
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Fri, 6 Feb 1998 15:04:17 +0000 (15:04 +0000)
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<use locale>
Date: Thu, 5 Feb 1998 21:46:25 -0500 (EST)

p4raw-id: //depot/perl@463

ext/Fcntl/Fcntl.pm
op.c
t/comp/proto.t
toke.c

index 6214323..74de3df 100644 (file)
@@ -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 (file)
--- 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;
index d1cfede..080110b 100755 (executable)
@@ -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 (file)
--- 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