* ext/ripper/eventids2.c (ripper_init_eventids2): use rb_intern_const.

* ext/ripper/tools/generate.rb (generate_eventids1): ditto.

* ext/ripper/tools/generate.rb (generate_eventids2_table): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-31 04:42:42 +00:00
parent 91e5f7d51a
commit 1a41f6dbf4
3 changed files with 57 additions and 49 deletions

View file

@ -79,13 +79,13 @@ def generate_eventids1(ids)
buf << %Q[ VALUE h;\n]
buf << %Q[ ID id;\n]
ids.each do |id, arity|
buf << %Q[ ripper_id_#{id} = rb_intern("on_#{id}");\n]
buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n]
end
buf << %Q[\n]
buf << %Q[ h = rb_hash_new();\n]
buf << %Q[ rb_define_const(self, "PARSER_EVENT_TABLE", h);\n]
ids.each do |id, arity|
buf << %Q[ id = rb_intern("#{id}");\n]
buf << %Q[ id = rb_intern_const("#{id}");\n]
buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(#{arity}));\n]
end
buf << %Q[}\n]
@ -101,7 +101,7 @@ def generate_eventids2_table(ids)
buf << %Q[ ID id;\n]
buf << %Q[ rb_define_const(self, "SCANNER_EVENT_TABLE", h);\n]
ids.each do |id|
buf << %Q[ id = rb_intern("#{id}");\n]
buf << %Q[ id = rb_intern_const("#{id}");\n]
buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(1));\n]
end
buf << %Q[}\n]