* parse.y (dsym): convert also literals containing NUL to

symbol.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-07-13 02:16:27 +00:00
parent 6dcf9f16cc
commit b1d5c752fb
2 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,10 @@
Fri Jul 13 11:09:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Jul 13 11:16:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (program, stmt, primary): reduced duplicated code.
* parse.y (dsym): convert also literals containing NUL to
symbol.
Fri Jul 13 10:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_flatten_bang): check argument if valid

View File

@ -3864,12 +3864,9 @@ dsym : tSYMBEG xstring_contents tSTRING_END
yyerror("empty symbol literal");
break;
}
if (strlen(RSTRING_PTR(lit)) == RSTRING_LEN(lit)) {
$$->nd_lit = ID2SYM(rb_intern(RSTRING_PTR($$->nd_lit)));
nd_set_type($$, NODE_LIT);
break;
}
/* fall through */
$$->nd_lit = ID2SYM(rb_intern2(RSTRING_PTR(lit), RSTRING_LEN(lit)));
nd_set_type($$, NODE_LIT);
break;
default:
$$ = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST($$));
break;