зеркало из https://github.com/github/ruby.git
parse.y: force_encoding
* parse.y (str_suffix_gen): String#b creates new string object, use force_encoding instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a056098cb7
Коммит
93ea04ecec
|
@ -1,3 +1,8 @@
|
|||
Mon Sep 2 17:53:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (str_suffix_gen): String#b creates new string object, use
|
||||
force_encoding instead.
|
||||
|
||||
Mon Sep 2 16:06:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||
|
||||
* NEWS: Add note about frozen string literals
|
||||
|
|
8
parse.y
8
parse.y
|
@ -6006,12 +6006,12 @@ parser_str_options(struct parser_params *parser)
|
|||
switch (c) {
|
||||
#if STR_OPTION_FROZEN
|
||||
case 'f':
|
||||
options |= STR_OPTION_FROZEN;
|
||||
options |= STR_OPTION_FROZEN;
|
||||
break;
|
||||
#endif
|
||||
#if STR_OPTION_BINARY
|
||||
case 'b':
|
||||
options |= STR_OPTION_BINARY;
|
||||
options |= STR_OPTION_BINARY;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -8576,7 +8576,9 @@ str_suffix_gen(struct parser_params *parser, NODE *node, long opt)
|
|||
else {
|
||||
#if STR_OPTION_BINARY
|
||||
if (opt & STR_OPTION_BINARY) {
|
||||
node = NEW_CALL(node, rb_intern("b"), 0);
|
||||
VALUE ascii8bit = rb_enc_from_encoding(rb_ascii8bit_encoding());
|
||||
NODE *args = NEW_LIST(NEW_LIT(ascii8bit));
|
||||
node = NEW_CALL(node, rb_intern("force_encoding"), args);
|
||||
}
|
||||
#endif
|
||||
#if STR_OPTION_FROZEN
|
||||
|
|
Загрузка…
Ссылка в новой задаче