aboutsummaryrefslogtreecommitdiffstats
path: root/ext/ripper/tools/strip.rb
blob: 0e409eb63bf0319f6a1bf3eae941b06cbee3e129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: false
last_is_void = false
ARGF.each do |line|
  case line
  when /\A\s*\z/, /\A\#/
    puts unless last_is_void
    last_is_void = true
  else
    print line
    last_is_void = false
  end
end