summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-30 15:37:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-30 15:37:56 +0000
commit795a6b23745305fe089983cf7a21f3f5820d6639 (patch)
treeee766e82acbd62927598254efc3e870489fadaa1 /parse.y
parentfba47c139755b1004301d5dcf44c77b3bc3f111e (diff)
parse.y: show name as possible
* parse.y (rb_id_attrset): show the name of broken ID if it is still registered. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 12 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 935b4c241b..676206a36d 100644
--- a/parse.y
+++ b/parse.y
@@ -8817,6 +8817,7 @@ block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
static ID rb_pin_dynamic_symbol(VALUE);
static ID attrsetname_to_attr(VALUE name);
+static int lookup_id_str(ID id, st_data_t *data);
ID
rb_id_attrset(ID id)
@@ -8838,8 +8839,17 @@ rb_id_attrset(ID id)
case ID_ATTRSET:
return id;
default:
- rb_name_error(id, "cannot make unknown type ID %d:%p attrset",
- scope, (void *)id);
+ {
+ st_data_t data;
+ if (lookup_id_str(id, &data)) {
+ rb_name_error(id, "cannot make unknown type ID %d:%"PRIsVALUE" attrset",
+ scope, (VALUE)data);
+ }
+ else {
+ rb_name_error(id, "cannot make unknown type ID %d:%"PRIxVALUE" attrset",
+ scope, (VALUE)id);
+ }
+ }
}
}
if (id&ID_STATIC_SYM) {