Unverified Commit 37c8cbe7 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4819 from shuujii/use-intern-instead-of-intern_cstr-if-possible-in-parse.y

Use `intern` instead of `intern_cstr` if possible in `parse.y`
parents 1259564c ac917983
...@@ -5765,7 +5765,7 @@ parser_yylex(parser_state *p) ...@@ -5765,7 +5765,7 @@ parser_yylex(parser_state *p)
tokadd(p, '$'); tokadd(p, '$');
tokadd(p, c); tokadd(p, c);
tokfix(p); tokfix(p);
pylval.id = intern_cstr(tok(p)); pylval.id = intern(tok(p), toklen(p));
return tGVAR; return tGVAR;
case '-': case '-':
...@@ -5775,7 +5775,7 @@ parser_yylex(parser_state *p) ...@@ -5775,7 +5775,7 @@ parser_yylex(parser_state *p)
pushback(p, c); pushback(p, c);
gvar: gvar:
tokfix(p); tokfix(p);
pylval.id = intern_cstr(tok(p)); pylval.id = intern(tok(p), toklen(p));
return tGVAR; return tGVAR;
case '&': /* $&: last match */ case '&': /* $&: last match */
...@@ -5941,7 +5941,7 @@ parser_yylex(parser_state *p) ...@@ -5941,7 +5941,7 @@ parser_yylex(parser_state *p)
if (IS_LABEL_SUFFIX(0)) { if (IS_LABEL_SUFFIX(0)) {
p->lstate = EXPR_END; p->lstate = EXPR_END;
tokfix(p); tokfix(p);
pylval.id = intern_cstr(tok(p)); pylval.id = intern(tok(p), toklen(p));
return tIDENTIFIER; return tIDENTIFIER;
} }
} }
...@@ -6000,7 +6000,7 @@ parser_yylex(parser_state *p) ...@@ -6000,7 +6000,7 @@ parser_yylex(parser_state *p)
} }
} }
{ {
mrb_sym ident = intern_cstr(tok(p)); mrb_sym ident = intern(tok(p), toklen(p));
pylval.id = ident; pylval.id = ident;
if (last_state != EXPR_DOT && ISLOWER(tok(p)[0]) && local_var_p(p, ident)) { if (last_state != EXPR_DOT && ISLOWER(tok(p)[0]) && local_var_p(p, ident)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment