class Farts::IfSyntaxNode

Public Class Methods

new( lineno, condition, stmts_true, stmts_false ) click to toggle source
# File lib/farts/farts_parser.rb, line 696
def initialize( lineno, condition, stmts_true, stmts_false )
  super lineno
  @condition = condition
  @stmts_true = stmts_true
  @stmts_false = stmts_false
end

Public Instance Methods

execute(intp) click to toggle source
# File lib/farts/farts_parser.rb, line 703
def execute(intp)
  if @condition.execute(intp)
    exec_list(intp, @stmts_true)
  else
    exec_list(intp, @stmts_false) if @stmts_false
  end
end