From b822c8ae778834a3cd2c7b11181a97874e84b6a5 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 30 Jan 2008 17:20:48 +0000 Subject: * parse.y (dsym): allow empty symbols. [ruby-core:15248] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 3718d99a2..377b8e9f2 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; -- cgit