diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-11 14:55:00 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-11 14:55:00 +0000 |
commit | b64a3e41202c86e5eaa410fe182b3dfdb2b0dc4c (patch) | |
tree | dfca666818ec67f8c525619dd4075d14b7ebb1ed /ext | |
parent | 0d2b4a6dd8df62fb796b05c734b1d97f1a6f1eda (diff) |
merge revision(s) r42479,r42490,r42509,r43083,r43084,r43085: [Backport #8756] [Backport #9248]
* parse.y (rb_enc_symname_type): allow ID_ATTRSET for ID_INSTANCE,
ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
* parse.y (rb_id_attrset): fix inconsistency with literals, allow
ID_ATTRSET and return it itself, but ID_JUNK cannot make ID_ATTRSET.
and raise a NameError instead of rb_bug() for invalid argument.
* parse.y (rb_id_attrset, intern_str): allow junk attrset ID for
Struct.
* parse.y (rb_id_attrset): check if the argument is valid type as an
attribute.
* parse.y (rb_id_attrset): allow other than ID_ATTRSET.
* parse.y (intern_str): ditto. try stem ID for ID_INSTANCE,
ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/-test-/symbol/type.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/-test-/symbol/type.c b/ext/-test-/symbol/type.c index 37406d3853..e0b2fff2f9 100644 --- a/ext/-test-/symbol/type.c +++ b/ext/-test-/symbol/type.c @@ -27,8 +27,17 @@ bug_sym_##type##_p(VALUE self, VALUE name) \ FOREACH_ID_TYPES(define_symbol_type_p) +static VALUE +bug_sym_attrset(VALUE self, VALUE name) +{ + ID id = rb_to_id(name); + id = rb_id_attrset(id); + return ID2SYM(id); +} + void Init_type(VALUE klass) { - FOREACH_ID_TYPES(declare_symbol_type_p) + FOREACH_ID_TYPES(declare_symbol_type_p); + rb_define_singleton_method(klass, "attrset", bug_sym_attrset, 1); } |