提交 5f07167f 编写于 作者: J Justin Collins

Add Sexp#resbody for RubyParser

上级 fd612b7c
......@@ -5,6 +5,11 @@ class Sexp
attr_reader :paren
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
......@@ -21,6 +26,12 @@ class Sexp
self.value.to_sym
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.
先完成此消息的编辑!
想要评论请 注册