diff options
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 32 |
1 files changed, 20 insertions, 12 deletions
@@ -2608,6 +2608,10 @@ parse_string(func, term, paren) rb_compile_error("unterminated string meets end of file"); return 0; } + if (paren) { + if (c == paren) nest++; + if (c == term && nest-- == 0) break; + } if (ismbchar(c)) { int i, len = mbclen(c)-1; @@ -2635,10 +2639,6 @@ parse_string(func, term, paren) } continue; } - if (paren) { - if (c == paren) nest++; - if (c == term && nest-- == 0) break; - } tokadd(c); } @@ -2682,6 +2682,10 @@ parse_qstring(term, paren) rb_compile_error("unterminated string meets end of file"); return 0; } + if (paren) { + if (c == paren) nest++; + if (c == term && nest-- == 0) break; + } if (ismbchar(c)) { int i, len = mbclen(c)-1; @@ -2709,10 +2713,6 @@ parse_qstring(term, paren) tokadd('\\'); } } - if (paren) { - if (c == paren) nest++; - if (c == term && nest-- == 0) break; - } tokadd(c); } @@ -2743,6 +2743,10 @@ parse_quotedwords(term, paren) rb_compile_error("unterminated string meets end of file"); return 0; } + if (paren) { + if (c == paren) nest++; + if (c == term && nest-- == 0) break; + } if (ismbchar(c)) { int i, len = mbclen(c)-1; @@ -2782,10 +2786,6 @@ parse_quotedwords(term, paren) pushback(c); continue; } - if (paren) { - if (c == paren) nest++; - if (c == term && nest-- == 0) break; - } tokadd(c); } @@ -4107,6 +4107,14 @@ str_extend(list, term, paren) newtok(); return list; } + else if (ismbchar(c)) { + int i, len = mbclen(c)-1; + + for (i = 0; i < len; i++) { + tokadd(c); + c = nextc(); + } + } case '\n': tokadd(c); break; |