diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-30 15:37:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-30 15:37:56 +0000 |
commit | 795a6b23745305fe089983cf7a21f3f5820d6639 (patch) | |
tree | ee766e82acbd62927598254efc3e870489fadaa1 /parse.y | |
parent | fba47c139755b1004301d5dcf44c77b3bc3f111e (diff) | |
download | ruby-795a6b23745305fe089983cf7a21f3f5820d6639.tar.gz |
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.y | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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) { |