diff --git a/ChangeLog b/ChangeLog index fd81b1a858..503f3da47f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Jan 31 02:15:49 2008 Yukihiro Matsumoto + + * parse.y (dsym): allow empty symbols. [ruby-core:15248] + Thu Jan 31 00:01:51 2008 Tanaka Akira * io.c (select_internal): fix SEGV by `select [STDIN],nil,[STDIN]'. diff --git a/parse.y b/parse.y index 3718d99a2b..377b8e9f23 100644 --- a/parse.y +++ b/parse.y @@ -3868,8 +3868,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END /*%%%*/ lex_state = EXPR_ENDARG; if (!($$ = $2)) { - $$ = NEW_NIL(); - yyerror("empty symbol literal"); + $$ = NEW_LIT(ID2SYM(rb_intern(""))); } else { VALUE lit; @@ -3880,10 +3879,6 @@ dsym : tSYMBEG xstring_contents tSTRING_END break; case NODE_STR: lit = $$->nd_lit; - if (RSTRING_LEN(lit) == 0) { - yyerror("empty symbol literal"); - break; - } $$->nd_lit = ID2SYM(rb_intern_str(lit)); nd_set_type($$, NODE_LIT); break;