summaryrefslogtreecommitdiff
path: root/template/id.h.tmpl
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-17 08:35:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-17 08:35:12 +0000
commitf7c2791c6092728077777cd6ffbc3476e5a11a42 (patch)
tree508dce1b86511f6cd5d4de9988028ff857d83369 /template/id.h.tmpl
parent200cea63268d934e88d8b42a95e2f1172bf1b605 (diff)
id.h.tmpl: preserved ids
* template/id.h.tmpl (preserved_ids): move from parse.y. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template/id.h.tmpl')
-rw-r--r--template/id.h.tmpl26
1 files changed, 25 insertions, 1 deletions
diff --git a/template/id.h.tmpl b/template/id.h.tmpl
index 9389887acb..15eb25baed 100644
--- a/template/id.h.tmpl
+++ b/template/id.h.tmpl
@@ -14,6 +14,7 @@
require 'optparse'
vpath = ["."]
input = nil
+
opt = OptionParser.new do |o|
o.on('-v', '--vpath=DIR') {|dirs| vpath.concat dirs.split(File::PATH_SEPARATOR)}
input, = o.order!(ARGV)
@@ -48,6 +49,23 @@ method_ids = %w[
Bitblt
Answer
]
+
+preserved_ids = %w[
+ NULL
+ Respond_to
+ IFUNC
+ CFUNC
+ _core_set_method_alias
+ _core_set_variable_alias
+ _core_undef_method
+ _core_define_method
+ _core_define_singleton_method
+ _core_set_postexe
+ _core_hash_from_ary
+ _core_hash_merge_ary
+ _core_hash_merge_ptr
+ _core_hash_merge_kwd
+]
%>
#ifndef RUBY_ID_H
#define RUBY_ID_H
@@ -105,7 +123,13 @@ enum ruby_method_ids {
idNeqTilde = tNMATCH,
idAREF = tAREF,
idASET = tASET,
- idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
+ tPRESERVED_ID_BEGIN = tLAST_TOKEN-1,
+% preserved_ids.each do |token|
+ id<%=token%>,
+% end
+ tPRESERVED_ID_END,
+ tLAST_OP_ID = tPRESERVED_ID_END-1,
+ idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT,
% method_ids.each do |token|
t<%=token%>,
% end