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

ruby-changes:50096

From: nobu <ko1@a...>
Date: Mon, 5 Feb 2018 09:52:48 +0900 (JST)
Subject: [ruby-changes:50096] nobu:r62214 (trunk): transform_mjit_header.rb: separate macro and code

nobu	2018-02-05 09:52:45 +0900 (Mon, 05 Feb 2018)

  New Revision: 62214

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62214

  Log:
    transform_mjit_header.rb: separate macro and code
    
    * tool/transform_mjit_header.rb (separate_macro_and_code): return
      macro and code separately as the name, and concat before output.

  Modified files:
    trunk/tool/transform_mjit_header.rb
Index: tool/transform_mjit_header.rb
===================================================================
--- tool/transform_mjit_header.rb	(revision 62213)
+++ tool/transform_mjit_header.rb	(revision 62214)
@@ -99,7 +99,7 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L99
 
   # This makes easier to process code
   def self.separate_macro_and_code(code)
-    code.lines.partition { |l| !l.start_with?('#') }.flatten.join('')
+    code.lines.partition { |l| l.start_with?('#') }.map! {|lines| lines.join('')}
   end
 
   def self.write(code, out)
@@ -142,7 +142,7 @@ if MJITHeader.windows? # transformation https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L142
 end
 puts "\nTransforming external functions to static:"
 
-code = MJITHeader.separate_macro_and_code(code) # note: this does not work on MinGW
+macro, code = MJITHeader.separate_macro_and_code(code) # note: this does not work on MinGW
 stop_pos     = -1
 extern_names = []
 
@@ -178,6 +178,8 @@ while (decl_range = MJITHeader.find_decl https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L178
   end
 end
 
+code << macro
+
 # Check the final file correctness
 MJITHeader.check_code!(code, cc, cflags, 'final')
 

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

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