mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (do_block): do_block event dispatches 2 args. [ruby-dev:26964]
* ext/ripper/lib/ripper/core.rb: updated. * ext/ripper/tools/list-parser-event-ids.rb: check arity mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1e63c302db
commit
04165c20fe
3 changed files with 20 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Mon Sep 19 14:39:46 2005 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* parse.y (do_block): do_block event dispatches 2 args.
|
||||||
|
[ruby-dev:26964]
|
||||||
|
|
||||||
|
* ext/ripper/lib/ripper/core.rb: updated.
|
||||||
|
|
||||||
|
* ext/ripper/tools/list-parser-event-ids.rb: check arity mismatch.
|
||||||
|
|
||||||
Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:
|
* ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:
|
||||||
|
|
|
@ -61,7 +61,6 @@ class Ripper
|
||||||
:def => 3,
|
:def => 3,
|
||||||
:defined => 1,
|
:defined => 1,
|
||||||
:defs => 5,
|
:defs => 5,
|
||||||
:do_block => 1,
|
|
||||||
:do_block => 2,
|
:do_block => 2,
|
||||||
:dot2 => 2,
|
:dot2 => 2,
|
||||||
:dot3 => 2,
|
:dot3 => 2,
|
||||||
|
@ -388,10 +387,6 @@ class Ripper
|
||||||
a
|
a
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_do_block(a)
|
|
||||||
a
|
|
||||||
end
|
|
||||||
|
|
||||||
def on_do_block(a, b)
|
def on_do_block(a, b)
|
||||||
a
|
a
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,17 +17,23 @@ def main
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_ids(f)
|
def extract_ids(f)
|
||||||
results = []
|
ids = {}
|
||||||
f.each do |line|
|
f.each do |line|
|
||||||
next if /\A\#\s*define\s+s?dispatch/ === line
|
next if /\A\#\s*define\s+s?dispatch/ =~ line
|
||||||
next if /ripper_dispatch/ === line
|
next if /ripper_dispatch/ =~ line
|
||||||
if a = line.scan(/dispatch(\d)\((\w+)/)
|
if a = line.scan(/dispatch(\d)\((\w+)/)
|
||||||
a.each do |arity, event|
|
a.each do |arity, event|
|
||||||
results.push [event, arity.to_i]
|
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
|
end
|
||||||
end
|
end
|
||||||
results.uniq.sort
|
ids.to_a.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue