summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-29 14:45:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-29 14:45:46 +0000
commit6496dc892dac58dc3267872c7a1f04bb7843dce3 (patch)
treef8bd0c642e26a4ee994c8d72a94bd8cb18aeeafc /parse.y
parent5a48805be81895a9137873a71110ea079ae3a875 (diff)
parse.y: allow junk attrset
* parse.y (rb_id_attrset, intern_str): allow junk attrset ID for Struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 1f2eea9ca8..5ae81267e3 100644
--- a/parse.y
+++ b/parse.y
@@ -8895,7 +8895,7 @@ rb_id_attrset(ID id)
int scope = (int)(id & ID_SCOPE_MASK);
switch (scope) {
case ID_LOCAL: case ID_INSTANCE: case ID_GLOBAL:
- case ID_CONST: case ID_CLASS:
+ case ID_CONST: case ID_CLASS: case ID_JUNK:
break;
case ID_ATTRSET:
return id;
@@ -10541,7 +10541,7 @@ intern_str(VALUE str)
}
if (name[last] == '=') {
/* attribute assignment */
- if (!rb_enc_symname2_p(name, last, enc))
+ if (last > 1 && name[last-1] == '=')
goto junk;
id = rb_intern3(name, last, enc);
if (id > tLAST_OP_ID && !is_attrset_id(id)) {