parser.h: Use UV for string delims
authorFather Chrysostomos <sprout@cpan.org>
Tue, 26 Jul 2016 07:47:16 +0000 (00:47 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 26 Jul 2016 08:52:25 +0000 (01:52 -0700)
We will need to store characters > 255 in here.

Also, cast accordingly in toke.c.

parser.h
toke.c

index 96ab4f5..35f172e 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -68,8 +68,8 @@ typedef struct yy_parser {
     SV         *lex_stuff;     /* runtime pattern from m// or s/// */
     I32                multi_start;    /* 1st line of multi-line string */
     I32                multi_end;      /* last line of multi-line string */
-    char       multi_open;     /* delimiter of said string */
-    char       multi_close;    /* delimiter of said string */
+    UV         multi_open;     /* delimiter of said string */
+    UV         multi_close;    /* delimiter of said string */
     bool       preambled;
     bool        lex_re_reparsing; /* we're doing G_RE_REPARSING */
     I32                lex_allbrackets;/* (), [], {}, ?: bracket count */
diff --git a/toke.c b/toke.c
index c42d037..d92723a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -10020,7 +10020,8 @@ S_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int re
                /* backslashes can escape the open or closing characters */
                if (*s == '\\' && s+1 < PL_bufend) {
                    if (!keep_bracketed_quoted
-                       && ((s[1] == PL_multi_open) || (s[1] == PL_multi_close)))
+                       && ( ((UV)s[1] == PL_multi_open)
+                         || ((UV)s[1] == PL_multi_close) ))
                     {
                        s++;
                     }
@@ -10028,9 +10029,9 @@ S_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int re
                        *to++ = *s++;
                 }
                /* allow nested opens and closes */
-               else if (*s == PL_multi_close && --brackets <= 0)
+               else if ((UV)*s == PL_multi_close && --brackets <= 0)
                    break;
-               else if (*s == PL_multi_open)
+               else if ((UV)*s == PL_multi_open)
                    brackets++;
                else if (!has_utf8 && !UTF8_IS_INVARIANT((U8)*s) && UTF)
                    has_utf8 = TRUE;