[前][次][番号順一覧][スレッド一覧]

ruby-changes:58657

From: Nobuyoshi <ko1@a...>
Date: Sat, 9 Nov 2019 00:22:08 +0900 (JST)
Subject: [ruby-changes:58657] 88b9a0f7fe (master): Prettify builtin_binary format

https://git.ruby-lang.org/ruby.git/commit/?id=88b9a0f7fe

From 88b9a0f7fe664098177f4d2f10aed08c4a42b03e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 9 Nov 2019 00:20:42 +0900
Subject: Prettify builtin_binary format


diff --git a/tool/mk_builtin_binary.rb b/tool/mk_builtin_binary.rb
index eaa560f..416c6ef 100644
--- a/tool/mk_builtin_binary.rb
+++ b/tool/mk_builtin_binary.rb
@@ -5,9 +5,10 @@ https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_binary.rb#L5
 def dump_bin iseq
   bin = iseq.to_binary
   bin.each_byte.with_index{|b, index|
-    print "\n  " if (index%20) == 0
-    print "0x#{'%02x' % b.ord}, "
+    print "\n " if (index%20) == 0
+    print " 0x#{'%02x' % b.ord},"
   }
+  print "\n"
 end
 
 ary = []
@@ -25,12 +26,12 @@ puts <<H https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_binary.rb#L26
 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)},"
 }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]