From 937dc9d3b3425e753162742ea5a3af9064b9d554 Mon Sep 17 00:00:00 2001 From: TSUYUSATO Kitsune Date: Sun, 25 Dec 2016 23:20:07 +0900 Subject: [PATCH] Fix for String#chomp changes (related to #3704) --- src/compiler/crystal/tools/expand.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/crystal/tools/expand.cr b/src/compiler/crystal/tools/expand.cr index 2c352a47ecc7..7cdbc4564896 100644 --- a/src/compiler/crystal/tools/expand.cr +++ b/src/compiler/crystal/tools/expand.cr @@ -14,11 +14,11 @@ module Crystal expansions.try &.each_with_index do |expansion, i| io.puts "expansion #{i + 1}:" io << " " - io.puts expansion.original.lines.join " " + io.puts expansion.original.lines(chomp: false).join " " io.puts expansion.expandeds.each_with_index do |expanded, j| io << "~> " - io.puts expanded.lines.join " " + io.puts expanded.lines(chomp: false).join " " io.puts end end @@ -38,7 +38,7 @@ module Crystal s = node.to_s return s unless node.is_a?(MacroIf) || node.is_a?(MacroFor) indent = node.location.not_nil!.column_number - 1 - s.lines.map do |line| + s.lines(chomp: false).map do |line| i = 0 line.each_char do |c| break unless c == ' ' && i < indent