lib/coffee_script/rewriter.rb in coffee-script-0.2.1 vs lib/coffee_script/rewriter.rb in coffee-script-0.2.2
- old
+ new
@@ -67,9 +67,13 @@
(before[0] == :OUTDENT && after[0] == :INDENT)) &&
before[1] == after[1]
@tokens.delete_at(i + 2)
@tokens.delete_at(i - 2)
next 0
+ elsif prev[0] == "\n" && [:INDENT, :OUTDENT].include?(after[0])
+ @tokens.delete_at(i + 2)
+ @tokens[i - 1] = after
+ next 1
elsif !["\n", :INDENT, :OUTDENT].include?(prev[0])
@tokens.insert(i, ["\n", Value.new("\n", token[1].line)])
next 2
else
next 1
\ No newline at end of file