ruby-changes:33686
From: nobu <ko1@a...>
Date: Thu, 1 May 2014 00:38:01 +0900 (JST)
Subject: [ruby-changes:33686] nobu:r45767 (trunk): parse.y: show name as possible
nobu 2014-05-01 00:37:56 +0900 (Thu, 01 May 2014) New Revision: 45767 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45767 Log: parse.y: show name as possible * parse.y (rb_id_attrset): show the name of broken ID if it is still registered. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 45766) +++ parse.y (revision 45767) @@ -8817,6 +8817,7 @@ block_dup_check_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L8817 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) https://github.com/ruby/ruby/blob/trunk/parse.y#L8839 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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/