summaryrefslogtreecommitdiff
path: root/ext/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 04:42:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 04:42:42 +0000
commit1a41f6dbf48c8c54f529b303f1310db6c34cc76b (patch)
tree3b86ce7d03415f80d6524bf874299e21e48501ae /ext/ripper
parent91e5f7d51af4256bb11edfba3c7918d534fc8181 (diff)
* 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
Diffstat (limited to 'ext/ripper')
-rw-r--r--ext/ripper/eventids2.c92
-rwxr-xr-xext/ripper/tools/generate.rb6
2 files changed, 49 insertions, 49 deletions
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index 6293814..74ec1ce 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -61,53 +61,53 @@ static ID ripper_id_CHAR;
static void
ripper_init_eventids2(VALUE self)
{
- ripper_id_backref = rb_intern("on_backref");
- ripper_id_backtick = rb_intern("on_backtick");
- ripper_id_comma = rb_intern("on_comma");
- ripper_id_const = rb_intern("on_const");
- ripper_id_cvar = rb_intern("on_cvar");
- ripper_id_embexpr_beg = rb_intern("on_embexpr_beg");
- ripper_id_embexpr_end = rb_intern("on_embexpr_end");
- ripper_id_embvar = rb_intern("on_embvar");
- ripper_id_float = rb_intern("on_float");
- ripper_id_gvar = rb_intern("on_gvar");
- ripper_id_ident = rb_intern("on_ident");
- ripper_id_int = rb_intern("on_int");
- ripper_id_ivar = rb_intern("on_ivar");
- ripper_id_kw = rb_intern("on_kw");
- ripper_id_lbrace = rb_intern("on_lbrace");
- ripper_id_lbracket = rb_intern("on_lbracket");
- ripper_id_lparen = rb_intern("on_lparen");
- ripper_id_nl = rb_intern("on_nl");
- ripper_id_op = rb_intern("on_op");
- ripper_id_period = rb_intern("on_period");
- ripper_id_rbrace = rb_intern("on_rbrace");
- ripper_id_rbracket = rb_intern("on_rbracket");
- ripper_id_rparen = rb_intern("on_rparen");
- ripper_id_semicolon = rb_intern("on_semicolon");
- ripper_id_symbeg = rb_intern("on_symbeg");
- ripper_id_tstring_beg = rb_intern("on_tstring_beg");
- ripper_id_tstring_content = rb_intern("on_tstring_content");
- ripper_id_tstring_end = rb_intern("on_tstring_end");
- ripper_id_words_beg = rb_intern("on_words_beg");
- ripper_id_qwords_beg = rb_intern("on_qwords_beg");
- ripper_id_words_sep = rb_intern("on_words_sep");
- ripper_id_regexp_beg = rb_intern("on_regexp_beg");
- ripper_id_regexp_end = rb_intern("on_regexp_end");
- ripper_id_label = rb_intern("on_label");
- ripper_id_tlambda = rb_intern("on_tlambda");
- ripper_id_tlambeg = rb_intern("on_tlambeg");
+ ripper_id_backref = rb_intern_const("on_backref");
+ ripper_id_backtick = rb_intern_const("on_backtick");
+ ripper_id_comma = rb_intern_const("on_comma");
+ ripper_id_const = rb_intern_const("on_const");
+ ripper_id_cvar = rb_intern_const("on_cvar");
+ ripper_id_embexpr_beg = rb_intern_const("on_embexpr_beg");
+ ripper_id_embexpr_end = rb_intern_const("on_embexpr_end");
+ ripper_id_embvar = rb_intern_const("on_embvar");
+ ripper_id_float = rb_intern_const("on_float");
+ ripper_id_gvar = rb_intern_const("on_gvar");
+ ripper_id_ident = rb_intern_const("on_ident");
+ ripper_id_int = rb_intern_const("on_int");
+ ripper_id_ivar = rb_intern_const("on_ivar");
+ ripper_id_kw = rb_intern_const("on_kw");
+ ripper_id_lbrace = rb_intern_const("on_lbrace");
+ ripper_id_lbracket = rb_intern_const("on_lbracket");
+ ripper_id_lparen = rb_intern_const("on_lparen");
+ ripper_id_nl = rb_intern_const("on_nl");
+ ripper_id_op = rb_intern_const("on_op");
+ ripper_id_period = rb_intern_const("on_period");
+ ripper_id_rbrace = rb_intern_const("on_rbrace");
+ ripper_id_rbracket = rb_intern_const("on_rbracket");
+ ripper_id_rparen = rb_intern_const("on_rparen");
+ ripper_id_semicolon = rb_intern_const("on_semicolon");
+ ripper_id_symbeg = rb_intern_const("on_symbeg");
+ ripper_id_tstring_beg = rb_intern_const("on_tstring_beg");
+ ripper_id_tstring_content = rb_intern_const("on_tstring_content");
+ ripper_id_tstring_end = rb_intern_const("on_tstring_end");
+ ripper_id_words_beg = rb_intern_const("on_words_beg");
+ ripper_id_qwords_beg = rb_intern_const("on_qwords_beg");
+ ripper_id_words_sep = rb_intern_const("on_words_sep");
+ ripper_id_regexp_beg = rb_intern_const("on_regexp_beg");
+ ripper_id_regexp_end = rb_intern_const("on_regexp_end");
+ ripper_id_label = rb_intern_const("on_label");
+ ripper_id_tlambda = rb_intern_const("on_tlambda");
+ ripper_id_tlambeg = rb_intern_const("on_tlambeg");
- ripper_id_ignored_nl = rb_intern("on_ignored_nl");
- ripper_id_comment = rb_intern("on_comment");
- ripper_id_embdoc_beg = rb_intern("on_embdoc_beg");
- ripper_id_embdoc = rb_intern("on_embdoc");
- ripper_id_embdoc_end = rb_intern("on_embdoc_end");
- ripper_id_sp = rb_intern("on_sp");
- ripper_id_heredoc_beg = rb_intern("on_heredoc_beg");
- ripper_id_heredoc_end = rb_intern("on_heredoc_end");
- ripper_id___end__ = rb_intern("on___end__");
- ripper_id_CHAR = rb_intern("on_CHAR");
+ ripper_id_ignored_nl = rb_intern_const("on_ignored_nl");
+ ripper_id_comment = rb_intern_const("on_comment");
+ ripper_id_embdoc_beg = rb_intern_const("on_embdoc_beg");
+ ripper_id_embdoc = rb_intern_const("on_embdoc");
+ ripper_id_embdoc_end = rb_intern_const("on_embdoc_end");
+ ripper_id_sp = rb_intern_const("on_sp");
+ ripper_id_heredoc_beg = rb_intern_const("on_heredoc_beg");
+ ripper_id_heredoc_end = rb_intern_const("on_heredoc_end");
+ ripper_id___end__ = rb_intern_const("on___end__");
+ ripper_id_CHAR = rb_intern_const("on_CHAR");
ripper_init_eventids2_table(self);
}
diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb
index 0efb997..22c3ac0 100755
--- a/ext/ripper/tools/generate.rb
+++ b/ext/ripper/tools/generate.rb
@@ -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]