mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
id.h.tmpl: ID2ATTRSET
* template/id.h.tmpl (ID2ATTRSET): compile time constant macro for ID_ATTRSET. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2edcf87c1c
commit
94a4bc0ef4
3 changed files with 8 additions and 1 deletions
|
@ -1,4 +1,7 @@
|
|||
Fri Dec 21 16:38:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Fri Dec 21 16:38:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* template/id.h.tmpl (ID2ATTRSET): compile time constant macro for
|
||||
ID_ATTRSET.
|
||||
|
||||
* defs/id.def (KeywordError): check duplication.
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ predefined.lines.each_with_index do |line, num|
|
|||
when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
|
||||
when /\A@@(?!\d)\w+\z/; class_ids
|
||||
when /\A@(?!\d)\w+\z/; instance_ids
|
||||
when /\A((?!\d)\w+)=\z/
|
||||
KeywordError.raise("use ID2ATTRSET(#{$1}) instead of ATTRSET #{name}", firstline+num)
|
||||
else preserved_ids
|
||||
end << token
|
||||
predefined_ids[token] = name
|
||||
|
|
|
@ -39,6 +39,8 @@ types = ids.keys.grep(/^[A-Z]/)
|
|||
#define ID_JUNK 0x07
|
||||
#define ID_INTERNAL ID_JUNK
|
||||
|
||||
#define ID2ATTRSET(id) (((id)&~ID_SCOPE_MASK)|ID_ATTRSET)
|
||||
|
||||
#define symIFUNC ID2SYM(idIFUNC)
|
||||
#define symCFUNC ID2SYM(idCFUNC)
|
||||
|
||||
|
|
Loading…
Reference in a new issue