class RedParse::ListInNode::RescueOpNode

Attributes

after_equals[RW]

Public Class Methods

namelist() click to toggle source
# File lib/redparse/node.rb, line 2236
def self.namelist
  %w[left right]
end
new(expr,rescueword,backup) click to toggle source
# File lib/redparse/node.rb, line 2232
def initialize(expr,rescueword,backup)
      replace [expr,[RescueNode[[],nil,backup]].extend(ListInNode)]
end

Public Instance Methods

begin_parsetree(o)
Alias for: parsetree
else() click to toggle source
# File lib/redparse/node.rb, line 2240
def else; nil end
Also aliased as: else_, empty_else
else_()
Alias for: else
empty_else()
Alias for: else
empty_ensure()
Alias for: ensure
ensure() click to toggle source
# File lib/redparse/node.rb, line 2241
def ensure; nil end
Also aliased as: ensure_, empty_ensure
ensure_()
Alias for: ensure
left() click to toggle source
# File lib/redparse/node.rb, line 2243
def left; body end
lvalue() click to toggle source
# File lib/redparse/node.rb, line 2297
def lvalue
  return nil 
end
old_rescue_parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 2288
def old_rescue_parsetree o
  result=parsetree o
  result=result.last unless o[:ruby187]
  result
end
op() click to toggle source
# File lib/redparse/node.rb, line 2245
def op; "rescue" end
op?() click to toggle source
# File lib/redparse/node.rb, line 2255
def op?; true end
parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 2266
      def parsetree(o)
          body=body()
          target=result=[]   #was: [:begin, ]

          #body,rescues,else_,ensure_=*self

          rescues=rescues().map{|resc| resc.parsetree(o)}
          target.push newtarget=[:rescue, ]
          #else_=nil
          needbegin=  (BeginNode===body and body.after_equals)
          huh if needbegin and RescueOpNode===body #need test case for this
          huh if needbegin and ParenedNode===body #need test case for this
          body=body.parsetree(o) 
          body=[:begin, body] if needbegin and body.first!=:begin and !o[:ruby187]
          newtarget.push body if body
          
          newtarget.push linked_list(rescues)
          result=result.last if result.size==1
#          result=[:begin,result]
          result
      end
Also aliased as: begin_parsetree, rescue_parsetree
rescue_parsetree(o)
Alias for: parsetree
rescue_with()
Alias for: right
right() click to toggle source
# File lib/redparse/node.rb, line 2244
def right; rescues[0].action end
Also aliased as: rescue_with
special_conditions!() click to toggle source
# File lib/redparse/node.rb, line 2257
def special_conditions!
  nil
end
to_lisp() click to toggle source
# File lib/redparse/node.rb, line 2261
def to_lisp
  huh #what about rescues
  body.to_lisp
end
unparse(o=default_unparse_options) click to toggle source
# File lib/redparse/node.rb, line 2301
def unparse(o=default_unparse_options)
    result= body.unparse(o)
    result+=" rescue "
    result+=rescues.first.action.unparse(o)
end