X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/b4db5868141d6a659beb640efc92eabae9cd71c0..08088357011bedc22047b1d4a1ec3afaee813523:/toke.c diff --git a/toke.c b/toke.c index ae832c0..4003ab1 100644 --- a/toke.c +++ b/toke.c @@ -399,7 +399,7 @@ S_tokereport(pTHX_ I32 rv, const YYSTYPE* lvalp) } if (name) Perl_sv_catpv(aTHX_ report, name); - else if ((char)rv > ' ' && (char)rv <= '~') + else if (isGRAPH(rv)) { Perl_sv_catpvf(aTHX_ report, "'%c'", (char)rv); if ((char)rv == 'p') @@ -2005,9 +2005,10 @@ S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack) s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, allow_pack, &len); if (check_keyword) { char *s2 = PL_tokenbuf; + STRLEN len2 = len; if (allow_pack && len > 6 && strnEQ(s2, "CORE::", 6)) - s2 += 6, len -= 6; - if (keyword(s2, len, 0)) + s2 += 6, len2 -= 6; + if (keyword(s2, len2, 0)) return start; } if (token == METHOD) { @@ -4948,7 +4949,7 @@ Perl_yylex(pTHX) Perl_croak(aTHX_ "\t(Maybe you didn't strip carriage returns after a network transfer?)\n"); #endif - case ' ': case '\t': case '\f': case 013: + case ' ': case '\t': case '\f': case '\v': s++; goto retry; case '#': @@ -10512,7 +10513,7 @@ S_scan_formline(pTHX_ char *s) if (needargs) { const char *s2 = s; while (*s2 == '\r' || *s2 == ' ' || *s2 == '\t' || *s2 == '\f' - || *s2 == 013) + || *s2 == '\v') s2++; if (*s2 == '{') { PL_expect = XTERMBLOCK; @@ -10634,7 +10635,7 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags) } else if (yychar > 255) sv_catpvs(where_sv, "next token ???"); - else if (yychar == -2) { /* YYEMPTY */ + else if (yychar == YYEMPTY) { if (PL_lex_state == LEX_NORMAL || (PL_lex_state == LEX_KNOWNEXT && PL_lex_defer == LEX_NORMAL)) sv_catpvs(where_sv, "at end of line");