class RedParse::ListInNode::UntilOpNode

Public Class Methods

new(val1,op,val2=nil) click to toggle source
# File lib/redparse/node.rb, line 2960
def initialize(val1,op,val2=nil)
  op,val2=nil,op unless val2
  op=op.ident if op.respond_to? :ident
  @reverse=true
  @loop=true
  @test_first= !( BeginNode===val1 ) 
  replace [val1,val2]
  condition.special_conditions! if condition.respond_to? :special_conditions!
end

Public Instance Methods

body()
Alias for: do
condition() click to toggle source
# File lib/redparse/node.rb, line 2958
def condition; right end
consequent() click to toggle source
# File lib/redparse/node.rb, line 2959
def consequent; left end
do() click to toggle source
# File lib/redparse/node.rb, line 2971
def do; consequent end
Also aliased as: body
op() click to toggle source
# File lib/redparse/node.rb, line 2973
def op; "until" end
parsetree(o) click to toggle source
# File lib/redparse/node.rb, line 2976
      def parsetree(o)
        cond=condition.rescue_parsetree(o)
        body=consequent.parsetree(o)
        !@test_first and
          body.size == 2 and
            body.first == :begin and
              body=body.last
        if cond.first==:not
          kw=:while
          cond=cond.last
        else
          kw=:until
        end
        tf=@test_first||body==[:nil]
#        tf||= (!consequent.body and !consequent.else and #!consequent.empty_else and
#               !consequent.ensure and !consequent.empty_ensure and consequent.rescues.empty?
#              ) if BeginNode===consequent
        [kw, cond, body, tf]
      end
reversed() click to toggle source
# File lib/redparse/node.rb, line 2974
def reversed; true end
while() click to toggle source
# File lib/redparse/node.rb, line 2970
def while; negate condition end