From 70ae83f8e18a2a3d65ee45dde318027be8b4f3c3 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Feb 2018 00:52:45 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/transform_mjit_header.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tool/transform_mjit_header.rb') diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index 7ce139f92a..143c393b66 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -99,7 +99,7 @@ module MJITHeader # 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 is broken with Windows headers for now 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(code, stop_pos)) end end +code << macro + # Check the final file correctness MJITHeader.check_code!(code, cc, cflags, 'final') -- cgit v1.2.3