зеркало из https://github.com/github/ruby.git
Prettify builtin_binary format
This commit is contained in:
Родитель
cd706c5216
Коммит
88b9a0f7fe
|
@ -8,6 +8,7 @@ def dump_bin iseq
|
|||
print "\n " if (index%20) == 0
|
||||
print " 0x#{'%02x' % b.ord},"
|
||||
}
|
||||
print "\n"
|
||||
end
|
||||
|
||||
ary = []
|
||||
|
@ -25,12 +26,12 @@ puts <<H
|
|||
H
|
||||
|
||||
ary.each{|feature, iseq|
|
||||
puts "static const unsigned char #{feature}_bin[] = {"
|
||||
print "\n""static const unsigned char #{feature}_bin[] = {"
|
||||
dump_bin(iseq)
|
||||
puts "};"
|
||||
}
|
||||
|
||||
puts "static const struct builtin_binary builtin_binary[] = {"
|
||||
print "\n""static const struct builtin_binary builtin_binary[] = {\n"
|
||||
ary.each{|feature, iseq|
|
||||
puts " {#{feature.dump}, #{feature}_bin, sizeof(#{feature}_bin)},"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче