Revert "Allow => to quote built-in keywords across lines"
authorFather Chrysostomos <sprout@cpan.org>
Sat, 13 Jul 2013 06:23:20 +0000 (23:23 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 13 Jul 2013 06:23:20 +0000 (23:23 -0700)
This reverts commit 5969c5766a5d3f6b42a5140548d7c3d6812fec8b.

It appears to be failing with non-mad builds.

embed.fnc
embed.h
proto.h
t/base/lex.t
toke.c

index 9873ba5..df387d1 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2212,7 +2212,7 @@ s |char*  |scan_word      |NN char *s|NN char *dest|STRLEN destlen \
                                |int allow_package|NN STRLEN *slp
 s      |void   |update_debugger_info|NULLOK SV *orig_sv \
                                |NULLOK const char *const buf|STRLEN len
-sR     |char*  |skipspace_flags|NN char *s|U32 flags
+sR     |char*  |skipspace      |NN char *s
 sR     |char*  |swallow_bom    |NN U8 *s
 #ifndef PERL_NO_UTF16_FILTER
 s      |I32    |utf16_textfilter|int idx|NN SV *sv|int maxlen
diff --git a/embed.h b/embed.h
index 82fa57d..2fc8466 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define scan_subst(a)          S_scan_subst(aTHX_ a)
 #define scan_trans(a)          S_scan_trans(aTHX_ a)
 #define scan_word(a,b,c,d,e)   S_scan_word(aTHX_ a,b,c,d,e)
-#define skipspace_flags(a,b)   S_skipspace_flags(aTHX_ a,b)
+#define skipspace(a)           S_skipspace(aTHX_ a)
 #define sublex_done()          S_sublex_done(aTHX)
 #define sublex_push()          S_sublex_push(aTHX)
 #define sublex_start()         S_sublex_start(aTHX)
diff --git a/proto.h b/proto.h
index b0197e5..242e35b 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -7340,10 +7340,10 @@ STATIC char*    S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_pa
 #define PERL_ARGS_ASSERT_SCAN_WORD     \
        assert(s); assert(dest); assert(slp)
 
-STATIC char*   S_skipspace_flags(pTHX_ char *s, U32 flags)
+STATIC char*   S_skipspace(pTHX_ char *s)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_SKIPSPACE_FLAGS       \
+#define PERL_ARGS_ASSERT_SKIPSPACE     \
        assert(s)
 
 STATIC I32     S_sublex_done(pTHX)
index 7821e76..7ef7538 100644 (file)
@@ -1,6 +1,6 @@
 #!./perl
 
-print "1..94\n";
+print "1..93\n";
 
 $x = 'x';
 
@@ -443,7 +443,3 @@ y # comment
  ;
 print "not " unless $_ eq 'b';
 print "ok 93 - y <comment> <newline> ...\n";
-
-print "not " unless (time
-                     =>) eq time=>;
-print "ok 94 - => quotes keywords across lines\n";
diff --git a/toke.c b/toke.c
index a9f1bb7..45f9f0e 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1512,16 +1512,14 @@ chunk will not be discarded.
 =cut
 */
 
-#define LEX_NO_INCLINE    0x40000000
 #define LEX_NO_NEXT_CHUNK 0x80000000
 
 void
 Perl_lex_read_space(pTHX_ U32 flags)
 {
     char *s, *bufend;
-    const bool can_incline = !(flags & LEX_NO_INCLINE);
     bool need_incline = 0;
-    if (flags & ~(LEX_KEEP_PREVIOUS|LEX_NO_NEXT_CHUNK|LEX_NO_INCLINE))
+    if (flags & ~(LEX_KEEP_PREVIOUS|LEX_NO_NEXT_CHUNK))
        Perl_croak(aTHX_ "Lexing code internal error (%s)", "lex_read_space");
 #ifdef PERL_MAD
     if (PL_skipwhite) {
@@ -1541,13 +1539,11 @@ Perl_lex_read_space(pTHX_ U32 flags)
            } while (!(c == '\n' || (c == 0 && s == bufend)));
        } else if (c == '\n') {
            s++;
-           if (can_incline) {
-               PL_parser->linestart = s;
-               if (s == bufend)
-                   need_incline = 1;
-               else
-                   incline(s);
-           }
+           PL_parser->linestart = s;
+           if (s == bufend)
+               need_incline = 1;
+           else
+               incline(s);
        } else if (isSPACE(c)) {
            s++;
        } else if (c == 0 && s == bufend) {
@@ -1559,14 +1555,14 @@ Perl_lex_read_space(pTHX_ U32 flags)
            if (flags & LEX_NO_NEXT_CHUNK)
                break;
            PL_parser->bufptr = s;
-           if (can_incline) COPLINE_INC_WITH_HERELINES;
+           COPLINE_INC_WITH_HERELINES;
            got_more = lex_next_chunk(flags);
-           if (can_incline) CopLINE_dec(PL_curcop);
+           CopLINE_dec(PL_curcop);
            s = PL_parser->bufptr;
            bufend = PL_parser->bufend;
            if (!got_more)
                break;
-           if (can_incline && need_incline && PL_parser->rsfp) {
+           if (need_incline && PL_parser->rsfp) {
                incline(s);
                need_incline = 0;
            }
@@ -1834,8 +1830,6 @@ S_incline(pTHX_ const char *s)
     CopLINE_set(PL_curcop, line_num);
 }
 
-#define skipspace(s) skipspace_flags(s, 0)
-
 #ifdef PERL_MAD
 /* skip space before PL_thistoken */
 
@@ -1941,12 +1935,12 @@ S_update_debugger_info(pTHX_ SV *orig_sv, const char *const buf, STRLEN len)
  */
 
 STATIC char *
-S_skipspace_flags(pTHX_ char *s, U32 flags)
+S_skipspace(pTHX_ char *s)
 {
 #ifdef PERL_MAD
     char *start = s;
 #endif /* PERL_MAD */
-    PERL_ARGS_ASSERT_SKIPSPACE_FLAGS;
+    PERL_ARGS_ASSERT_SKIPSPACE;
 #ifdef PERL_MAD
     if (PL_skipwhite) {
        sv_free(PL_skipwhite);
@@ -1959,7 +1953,7 @@ S_skipspace_flags(pTHX_ char *s, U32 flags)
     } else {
        STRLEN bufptr_pos = PL_bufptr - SvPVX(PL_linestr);
        PL_bufptr = s;
-       lex_read_space(flags | LEX_KEEP_PREVIOUS |
+       lex_read_space(LEX_KEEP_PREVIOUS |
                (PL_sublex_info.sub_inwhat || PL_lex_state == LEX_FORMLINE ?
                    LEX_NO_NEXT_CHUNK : 0));
        s = PL_bufptr;
@@ -6967,7 +6961,6 @@ Perl_yylex(pTHX)
 
        /* Is this a word before a => operator? */
        if (*d == '=' && d[1] == '>') {
-         fat_arrow:
            CLINE;
            pl_yylval.opval
                = (OP*)newSVOP(OP_CONST, 0,
@@ -7101,18 +7094,6 @@ Perl_yylex(pTHX)
            }
        }
 
-       if (tmp && tmp != KEY___DATA__ && tmp != KEY___END__
-        && (!anydelim || *s != '#')) {
-           /* no override, and not s### either; skipspace is safe here
-            * check for => on following line */
-           STRLEN bufoff = PL_bufptr - SvPVX(PL_linestr);
-           STRLEN   soff = s         - SvPVX(PL_linestr);
-           s = skipspace_flags(s, LEX_NO_INCLINE);
-           if (*s == '=' && s[1] == '>') goto fat_arrow;
-           PL_bufptr = SvPVX(PL_linestr) + bufoff;
-           s         = SvPVX(PL_linestr) +   soff;
-       }
-
       reserved_word:
        switch (tmp) {