1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/ripper/tools/list-scan-event-ids.rb
aamine 98258515dd * ext/ripper/tools/list-parse-event-ids.rb: does not use getopts.
* ext/ripper/tools/list-scan-event-ids.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-12 21:44:13 +00:00

23 lines
327 B
Ruby
Executable file

# $Id$
def main
if ARGV.first == '-a'
with_arity = true
ARGV.delete_at 0
else
with_arity = false
end
extract_ids(ARGF).sort.each do |id|
if with_arity
puts "#{id} 1"
else
puts id
end
end
end
def extract_ids(f)
(f.read.scan(/ripper_id_(\w+)/).flatten - ['scan']).uniq
end
main