Skip to content

Commit

Permalink
Verify that events2table.c was generated successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 28, 2023
1 parent 051a874 commit 7016ab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/ripper/eventids2.c
Expand Up @@ -65,6 +65,8 @@ static ripper_scanner_ids_t ripper_scanner_ids;

#include "eventids2table.c"

STATIC_ASSERT(eventids2_table_size, RIPPER_EVENTIDS2_TABLE_SIZE == sizeof(ripper_scanner_ids)/sizeof(ID));

void
ripper_init_eventids2(void)
{
Expand Down
2 changes: 2 additions & 0 deletions ext/ripper/tools/generate.rb
Expand Up @@ -136,6 +136,8 @@ def generate_eventids2_table(ids)
buf << %Q[ rb_hash_aset(h, intern_sym("#{id}"), INT2FIX(1));\n]
end
buf << %Q[}\n]
buf << %Q[\n]
buf << %Q[#define RIPPER_EVENTIDS2_TABLE_SIZE #{ids.size}\n]
buf
end

Expand Down

0 comments on commit 7016ab8

Please sign in to comment.