open FOO || die; doesn't need a special identifier parser.
authorBrian Fraser <fraserbn@gmail.com>
Tue, 5 Mar 2013 23:40:34 +0000 (20:40 -0300)
committerKarl Williamson <public@khwilliamson.com>
Wed, 6 Mar 2013 22:02:40 +0000 (15:02 -0700)
Turns out this can just use scan_word().

toke.c

index 1ea0da7..4579e63 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -8105,15 +8105,9 @@ Perl_yylex(pTHX)
        case KEY_open:
            s = SKIPSPACE1(s);
            if (isIDFIRST_lazy_if(s,UTF)) {
-               const char *t;
-               for (d = s; isWORDCHAR_lazy_if(d,UTF);) {
-                   d += UTF ? UTF8SKIP(d) : 1;
-                    if (UTF) {
-                        while (isIDCONT_utf8((U8*)d)) {
-                            d += UTF ? UTF8SKIP(d) : 1;
-                        }
-                    }
-                }
+          const char *t;
+          d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE,
+              &len);
                for (t=d; isSPACE(*t);)
                    t++;
                if ( *t && strchr("|&*+-=!?:.", *t) && ckWARN_d(WARN_PRECEDENCE)