From 50702d16ab5862413351520b65da820194dbf8d7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 Nov 2017 15:37:48 +0000 Subject: parse.y: zero codepoints * parse.y (parser_tokadd_utf8): relax restriction to allow zero or more codepoints. fixup r59417. https://github.com/ruby/ruby/commit/7e8b910#commitcomment-25602670 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 8f44534deb..f7349496cd 100644 --- a/parse.y +++ b/parse.y @@ -5999,7 +5999,7 @@ parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int c, last = nextc(); if (lex_p >= lex_pend) goto unterminated; while (ISSPACE(c = *lex_p) && ++lex_p < lex_pend); - do { + while (c != close_brace) { if (regexp_literal) tokadd(last); if (!parser_tokadd_codepoint(parser, encp, regexp_literal, TRUE)) { break; @@ -6008,7 +6008,7 @@ parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, if (++lex_p >= lex_pend) goto unterminated; last = c; } - } while (c != close_brace); + } if (c != close_brace) { unterminated: -- cgit v1.2.3