Skip to content

Commit

Permalink
improve misc/collect-min-version-macro.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
msakai committed Nov 10, 2024
1 parent d765164 commit 736e734
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions misc/collect-min-version-macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

base = ARGV[0] || "."

a = []
h = {}

Dir.glob("**/*.hs", base: base){|fname|
File.open(fname, encoding: "utf-8"){|f|
f.each_line{|l|
if /MIN_VERSION_\w+\(\d+,\d+,\d+\)/ =~ l
a << $~[0]
(h[$~[0]] ||= []) << fname
end
}
}
}

a.sort.uniq.each{|l|
puts l
h.keys.sort.each {|k|
puts k
h[k].each {|fname|
puts " #{fname}"
}
}

0 comments on commit 736e734

Please sign in to comment.