summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-31 15:36:22 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-31 15:36:22 +0000
commit3f1da781c56e779e303b23d0bf0053780f342e5b (patch)
tree61924cdd34e889e6936baf258823be999b180af2 /parse.y
parent54a55edb9627bd31eda8d486f43cb34b65ee3295 (diff)
* parse.y (dsym): Allow empty symbols. [merge from 1.9]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 1 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index ed61a7ce80..44d4888413 100644
--- a/parse.y
+++ b/parse.y
@@ -2282,8 +2282,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END
{
lex_state = EXPR_END;
if (!($$ = $2)) {
- $$ = NEW_NIL();
- yyerror("empty symbol literal");
+ $$ = NEW_LIT(ID2SYM(rb_intern("")));
}
else {
VALUE lit;
@@ -2294,10 +2293,6 @@ dsym : tSYMBEG xstring_contents tSTRING_END
break;
case NODE_STR:
lit = $$->nd_lit;
- if (RSTRING(lit)->len == 0) {
- yyerror("empty symbol literal");
- break;
- }
if (strlen(RSTRING(lit)->ptr) == RSTRING(lit)->len) {
$$->nd_lit = ID2SYM(rb_intern(RSTRING($$->nd_lit)->ptr));
nd_set_type($$, NODE_LIT);