summaryrefslogtreecommitdiff
path: root/ext/ripper/tools/generate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ripper/tools/generate.rb')
-rwxr-xr-xext/ripper/tools/generate.rb11
1 files changed, 7 insertions, 4 deletions
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]