Netware tweaks from Guruprasad.
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index fca0f73..751253e 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -43,7 +43,7 @@ static I32 utf16rev_textfilter(pTHXo_ int idx, SV *sv, int maxlen);
 #define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || (PL_hints & HINT_UTF8))
 #endif
 
-/* In variables name $^X, these are the legal values for X.
+/* In variables named $^X, these are the legal values for X.
  * 1999-02-27 mjd-perl-patch@plover.com */
 #define isCONTROLVAR(x) (isUPPER(x) || strchr("[\\]^_?", (x)))
 
@@ -1257,7 +1257,7 @@ S_scan_const(pTHX_ char *start)
                    char *e = d++;
                    while (e-- > c)
                        *(e + 1) = *e;
-                   *c = UTF_TO_NATIVE(0xff);
+                   *c = (char)UTF_TO_NATIVE(0xff);
                    /* mark the range as done, and continue */
                    dorange = FALSE;
                    didrange = TRUE;
@@ -1308,7 +1308,7 @@ S_scan_const(pTHX_ char *start)
                    Perl_croak(aTHX_ "Ambiguous range in transliteration operator");
                }
                if (has_utf8) {
-                   *d++ = UTF_TO_NATIVE(0xff); /* use illegal utf8 byte--see pmtrans */
+                   *d++ = (char)UTF_TO_NATIVE(0xff);   /* use illegal utf8 byte--see pmtrans */
                    s++;
                    continue;
                }
@@ -1374,7 +1374,7 @@ S_scan_const(pTHX_ char *start)
        else if (*s == '$') {
            if (!PL_lex_inpat)  /* not a regexp, so $ must be var */
                break;
-           if (s + 1 < send && !strchr("()| \n\t", s[1]))
+           if (s + 1 < send && !strchr("()| \r\n\t", s[1]))
                break;          /* in regexp, $ might be tail anchor */
        }
 
@@ -3091,8 +3091,8 @@ Perl_yylex(pTHX)
                    else if (!PL_in_my && len == 6 && strnEQ(s, "method", len))
                        CvMETHOD_on(PL_compcv);
 #ifdef USE_ITHREADS
-                   else if (PL_in_my == KEY_our && len == 6 && strnEQ(s, "shared", len))
-                       GvSHARED_on(cGVOPx_gv(yylval.opval));
+      else if (PL_in_my == KEY_our && len == 6 && strnEQ(s, "unique", len))
+                       GvUNIQUE_on(cGVOPx_gv(yylval.opval));
 #endif
                    /* After we've set the flags, it could be argued that
                       we don't need to do the attributes.pm-based setting
@@ -3925,6 +3925,7 @@ Perl_yylex(pTHX)
        default:                        /* not a keyword */
          just_a_word: {
                SV *sv;
+               int pkgname = 0;
                char lastchar = (PL_bufptr == PL_oldoldbufptr ? 0 : PL_bufptr[-1]);
 
                /* Get the rest if it looks like a package qualifier */
@@ -3937,6 +3938,7 @@ Perl_yylex(pTHX)
                        Perl_croak(aTHX_ "Bad name after %s%s", PL_tokenbuf,
                                *s == '\'' ? "'" : "::");
                    len += morelen;
+                   pkgname = 1;
                }
 
                if (PL_expect == XOPERATOR) {
@@ -4024,12 +4026,11 @@ Perl_yylex(pTHX)
                    }
                }
 
-
                PL_expect = XOPERATOR;
                s = skipspace(s);
 
                /* Is this a word before a => operator? */
-               if (*s == '=' && s[1] == '>') {
+               if (*s == '=' && s[1] == '>' && !pkgname) {
                    CLINE;
                    sv_setpv(((SVOP*)yylval.opval)->op_sv, PL_tokenbuf);
                    if (UTF && !IN_BYTES && is_utf8_string((U8*)PL_tokenbuf, len))