diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ripper/eventids2.c | 4 | ||||
-rwxr-xr-x | ext/ripper/tools/generate.rb | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c index 8b0d9c3757..dfe6c08619 100644 --- a/ext/ripper/eventids2.c +++ b/ext/ripper/eventids2.c @@ -59,7 +59,7 @@ static ID ripper_id_CHAR; #include "eventids2table.c" static void -ripper_init_eventids2(VALUE self) +ripper_init_eventids2(void) { ripper_id_backref = rb_intern_const("on_backref"); ripper_id_backtick = rb_intern_const("on_backtick"); @@ -108,8 +108,6 @@ ripper_init_eventids2(VALUE self) 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); } static const struct token_assoc { diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb index 22c3ac0eb7..333b64afae 100755 --- a/ext/ripper/tools/generate.rb +++ b/ext/ripper/tools/generate.rb @@ -74,15 +74,18 @@ def generate_eventids1(ids) end buf << %Q[\n] buf << %Q[static void\n] - buf << %Q[ripper_init_eventids1(VALUE self)\n] + buf << %Q[ripper_init_eventids1(void)\n] buf << %Q[{\n] - buf << %Q[ VALUE h;\n] - buf << %Q[ ID id;\n] ids.each do |id, arity| buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n] end + buf << %Q[}\n] buf << %Q[\n] - buf << %Q[ h = rb_hash_new();\n] + buf << %Q[static void\n] + buf << %Q[ripper_init_eventids1_table(VALUE self)\n] + buf << %Q[{\n] + buf << %Q[ VALUE h = rb_hash_new();\n] + buf << %Q[ ID id;\n] buf << %Q[ rb_define_const(self, "PARSER_EVENT_TABLE", h);\n] ids.each do |id, arity| buf << %Q[ id = rb_intern_const("#{id}");\n] |