summaryrefslogtreecommitdiff
path: root/ext/ripper/tools/list-parse-event-ids.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ripper/tools/list-parse-event-ids.rb')
-rwxr-xr-xext/ripper/tools/list-parse-event-ids.rb39
1 files changed, 0 insertions, 39 deletions
diff --git a/ext/ripper/tools/list-parse-event-ids.rb b/ext/ripper/tools/list-parse-event-ids.rb
deleted file mode 100755
index a8566fcbcf..0000000000
--- a/ext/ripper/tools/list-parse-event-ids.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# $Id$
-
-def main
- if ARGV[0] == '-a'
- with_arity = true
- ARGV.delete_at 0
- else
- with_arity = false
- end
- extract_ids(ARGF).each do |id, arity|
- if with_arity
- puts "#{id} #{arity}"
- else
- puts id
- end
- end
-end
-
-def extract_ids(f)
- ids = {}
- f.each do |line|
- next if /\A\#\s*define\s+s?dispatch/ =~ line
- next if /ripper_dispatch/ =~ line
- if a = line.scan(/dispatch(\d)\((\w+)/)
- a.each do |arity, event|
- if ids[event]
- unless ids[event] == arity.to_i
- $stderr.puts "arity mismatch: #{event} (#{ids[event]} vs #{arity})"
- exit 1
- end
- end
- ids[event] = arity.to_i
- end
- end
- end
- ids.to_a.sort
-end
-
-main