Commit 7f095534 authored by Jon's avatar Jon

Refine pretty-print indenting

parent 26f353d8
...@@ -214,7 +214,7 @@ module MRuby ...@@ -214,7 +214,7 @@ module MRuby
@command ||= @build.mrbcfile @command ||= @build.mrbcfile
IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io| IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io|
[infiles].flatten.each do |f| [infiles].flatten.each do |f|
_pp " MRBC", "#{f}" _pp "MRBC", "#{f}", nil, :indent => 2
io.write IO.read(f) io.write IO.read(f)
end end
io.close_write io.close_write
......
...@@ -57,6 +57,10 @@ else ...@@ -57,6 +57,10 @@ else
$pp_show = false if $verbose $pp_show = false if $verbose
end end
def _pp(cmd, src, tgt=nil) def _pp(cmd, src, tgt=nil, options={})
puts '%-5s %s %s' % [cmd, src, tgt ? "-> #{tgt}" : nil] if $pp_show return unless $pp_show
width = 5
template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s"
puts template % [cmd, src, tgt ? "-> #{tgt}" : nil]
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment