summaryrefslogtreecommitdiff
path: root/template/id.h.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/id.h.tmpl')
-rw-r--r--template/id.h.tmpl20
1 files changed, 11 insertions, 9 deletions
diff --git a/template/id.h.tmpl b/template/id.h.tmpl
index 9df7947..0a480f4 100644
--- a/template/id.h.tmpl
+++ b/template/id.h.tmpl
@@ -29,18 +29,20 @@ types = ids.keys.grep(/^[A-Z]/)
#define RUBY_ID_H
enum ruby_id_types {
+ RUBY_ID_STATIC_SYM = 0x01,
RUBY_ID_LOCAL = 0x00,
- RUBY_ID_INSTANCE = 0x01,
- RUBY_ID_GLOBAL = 0x03,
- RUBY_ID_ATTRSET = 0x04,
- RUBY_ID_CONST = 0x05,
- RUBY_ID_CLASS = 0x06,
- RUBY_ID_JUNK = 0x07,
+ RUBY_ID_INSTANCE = (0x01<<1),
+ RUBY_ID_GLOBAL = (0x03<<1),
+ RUBY_ID_ATTRSET = (0x04<<1),
+ RUBY_ID_CONST = (0x05<<1),
+ RUBY_ID_CLASS = (0x06<<1),
+ RUBY_ID_JUNK = (0x07<<1),
RUBY_ID_INTERNAL = RUBY_ID_JUNK,
- RUBY_ID_SCOPE_SHIFT = 3,
- RUBY_ID_SCOPE_MASK = ~(~0U<<RUBY_ID_SCOPE_SHIFT)
+ RUBY_ID_SCOPE_SHIFT = 4,
+ RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
};
+#define ID_STATIC_SYM RUBY_ID_STATIC_SYM
#define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT
#define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK
#define ID_LOCAL RUBY_ID_LOCAL
@@ -99,7 +101,7 @@ enum ruby_method_ids {
% types.each do |type|
% types = ids[type] or next
% types.empty? and next
-#define TOKEN2<%=type%>ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_<%=type%>)
+#define TOKEN2<%=type%>ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_<%=type%>|ID_STATIC_SYM)
% types.each do |token|
TOKEN2<%=type%>ID(<%=token%>),
% end