提交 dbad4ed3 编写于 作者: J Justin Collins

Merge branch 'remove_method_missing_from_sexp'

Remove method_missing behavior from Sexp

Conflicts:
	lib/ruby_parser/bm_sexp.rb
......@@ -5,6 +5,15 @@ class Sexp
attr_reader :paren
ASSIGNMENT_BOOL = [:gasgn, :iasgn, :lasgn, :cvdecl, :cdecl, :or, :and]
def method_missing name, *args
#Brakeman does not use this functionality,
#so overriding it to raise a NoMethodError.
#
#The original functionality calls find_node and optionally
#deletes the node if found.
raise NoMethodError.new("No method '#{name}' for Sexp", name, args)
end
def paren
@paren ||= false
end
......@@ -26,6 +35,12 @@ class Sexp
self[0] = type
end
def resbody delete = false
#RubyParser relies on method_missing for this, but since we don't want to use
#method_missing, here's a real method.
find_node :resbody, delete
end
alias :node_type :sexp_type
alias :values :sexp_body # TODO: retire
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册