diff --git a/lib/yard/parser/ruby/ruby_parser.rb b/lib/yard/parser/ruby/ruby_parser.rb index a7085b5e0..912564453 100644 --- a/lib/yard/parser/ruby/ruby_parser.rb +++ b/lib/yard/parser/ruby/ruby_parser.rb @@ -144,7 +144,7 @@ def file_encoding PARSER_EVENT_TABLE.each do |event, arity| node_class = AstNode.node_class_for(event) - if /_new\z/ =~ event.to_s && arity == 0 + if arity == 0 && /_new\z/ =~ event.to_s module_eval(<<-eof, __FILE__, __LINE__ + 1) def on_#{event}(*args) #{node_class}.new(:list, args, :listchar => charno...charno, :listline => lineno..lineno)