1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: intern_cstr

* parse.y (intern_cstr): remove `_without_pindown` suffix and use
  rb_intern3() as well as RIPPER, for the time being.
  [ruby-core:65009] [Bug #10206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-09-13 01:28:57 +00:00
parent 0fa9553604
commit da7475b00d

10
parse.y
View file

@ -283,16 +283,16 @@ struct parser_params {
}; };
#ifdef RIPPER #ifdef RIPPER
#define intern_cstr_without_pindown(n,l,en) rb_intern3(n,l,en) #define intern_cstr(n,l,en) rb_intern3(n,l,en)
#else #else
#define intern_cstr_without_pindown(n,l,en) rb_intern_cstr_without_pindown(n,l,en) #define intern_cstr(n,l,en) rb_intern3(n,l,en)
#endif #endif
#define STR_NEW(p,n) rb_enc_str_new((p),(n),current_enc) #define STR_NEW(p,n) rb_enc_str_new((p),(n),current_enc)
#define STR_NEW0() rb_enc_str_new(0,0,current_enc) #define STR_NEW0() rb_enc_str_new(0,0,current_enc)
#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),current_enc) #define STR_NEW2(p) rb_enc_str_new((p),strlen(p),current_enc)
#define STR_NEW3(p,n,e,func) parser_str_new((p),(n),(e),(func),current_enc) #define STR_NEW3(p,n,e,func) parser_str_new((p),(n),(e),(func),current_enc)
#define TOK_INTERN() intern_cstr_without_pindown(tok(), toklen(), current_enc) #define TOK_INTERN() intern_cstr(tok(), toklen(), current_enc)
static int parser_yyerror(struct parser_params*, const char*); static int parser_yyerror(struct parser_params*, const char*);
#define yyerror(msg) parser_yyerror(parser, (msg)) #define yyerror(msg) parser_yyerror(parser, (msg))
@ -7447,7 +7447,7 @@ parse_gvar(struct parser_params *parser, const enum lex_state_e last_state)
return '$'; return '$';
} }
gvar: gvar:
set_yylval_name(intern_cstr_without_pindown(tok(), tokidx, current_enc)); set_yylval_name(intern_cstr(tok(), tokidx, current_enc));
return tGVAR; return tGVAR;
case '&': /* $&: last match */ case '&': /* $&: last match */
@ -9941,7 +9941,7 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
!rb_enc_symname2_p(s, len, enc)) { !rb_enc_symname2_p(s, len, enc)) {
return ST_CONTINUE; return ST_CONTINUE;
} }
var = intern_cstr_without_pindown(s, len, enc); var = intern_cstr(s, len, enc);
if (dvar_defined(var) || local_id(var)) { if (dvar_defined(var) || local_id(var)) {
rb_warningV("named capture conflicts a local variable - %"PRIsVALUE, rb_warningV("named capture conflicts a local variable - %"PRIsVALUE,
rb_id2str(var)); rb_id2str(var));