1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ripper/dummyparser.rb: suppress redefinition warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-10-03 12:25:32 +00:00
parent 9603cd2f62
commit 2957020491

View file

@ -47,13 +47,6 @@ class NodeList
end
class DummyParser < Ripper
Ripper::PARSER_EVENTS.each do |event|
event = event.to_s
define_method(:"on_#{event}") do |*args|
Node.new(event, *args)
end
end
def hook(name)
class << self; self; end.class_eval do
define_method(name) do |*a, &b|
@ -188,4 +181,10 @@ class DummyParser < Ripper
def on_assoclist_from_args(a)
Node.new('assocs', *a.list)
end
(Ripper::PARSER_EVENTS.map(&:to_s) - instance_methods(false).map {|n|n.to_s.sub(/^on_/, '')}).each do |event|
define_method(:"on_#{event}") do |*args|
Node.new(event, *args)
end
end
end