diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-11 09:20:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-11 09:20:27 +0000 |
commit | 7e8b910a5629fe025137e890ec6d57e538fd7811 (patch) | |
tree | dbdfffa8b14e81a8ee90ceb49f8cb458a9253c5e /parse.y | |
parent | 1d51f427ff22e9fa9adfea9855c8344f493a3b95 (diff) |
parse.y: zero codepoints
* parse.y (parser_tokadd_utf8): relax restriction to allow zero or
more codepoints.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5809,14 +5809,15 @@ parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int c, last = nextc(); do c = nextc(); while (ISSPACE(c)); pushback(c); - do { + while (!string_literal || c != close_brace) { if (regexp_literal) tokadd(last); if (!parser_tokadd_codepoint(parser, encp, regexp_literal, TRUE)) { return 0; } while (ISSPACE(c = nextc())) last = c; pushback(c); - } while (string_literal && c != close_brace); + if (!string_literal) break; + } if (c != close_brace) { yyerror("unterminated Unicode escape"); |