1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
require 'erb' types = %w[ state aspec value int float bool sym ] type_c = ERB.new(<<~TEMPLATE).result <% types.each do |type| %> typedef mrb_<%= type %> minu_<%= type %> ; <% end %> typedef mrb_func_t minu_func_t; TEMPLATE puts type_c