summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y18
1 files changed, 10 insertions, 8 deletions
diff --git a/parse.y b/parse.y
index f365b1f575..75c0ad8acd 100644
--- a/parse.y
+++ b/parse.y
@@ -4737,20 +4737,22 @@ rb_id2name(id)
return name;
if (is_attrset_id(id)) {
- char *res;
- ID id2;
+ ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
- id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
- res = rb_id2name(id2);
+ again:
+ name = rb_id2name(id2);
+ if (name) {
+ char *buf = ALLOCA_N(char, strlen(name)+2);
- if (res) {
- char *buf = ALLOCA_N(char, strlen(res)+2);
-
- strcpy(buf, res);
+ strcpy(buf, name);
strcat(buf, "=");
rb_intern(buf);
return rb_id2name(id);
}
+ if (is_local_id(id2)) {
+ id2 = (id & ~ID_SCOPE_MASK) | ID_CONST;
+ goto again;
+ }
}
return 0;
}