* 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:
parent
6dcf9f16cc
commit
b1d5c752fb
@ -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
|
||||
|
9
parse.y
9
parse.y
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user