class CodeTools::AST::Not

Attributes

value[RW]

Public Class Methods

new(line, value) click to toggle source
# File lib/rubinius/code/ast/operators.rb, line 56
def initialize(line, value)
  @line = line
  @value = value
end

Public Instance Methods

bytecode(g) click to toggle source
# File lib/rubinius/code/ast/operators.rb, line 61
def bytecode(g)
  true_label = g.new_label
  end_label = g.new_label

  @value.bytecode(g)
  g.goto_if_true true_label

  g.push_true
  g.goto end_label

  true_label.set!
  g.push_false
  end_label.set!
end
defined(g) click to toggle source
# File lib/rubinius/code/ast/operators.rb, line 76
def defined(g)
  t = g.new_label
  f = g.new_label
  done = g.new_label

  case @value
  when GlobalVariableAccess, InstanceVariableAccess
    g.goto t
  else
    @value.value_defined(g, f)
    g.pop
  end

  t.set!
  g.push_literal "expression"
  g.goto done

  f.set!
  g.push_tagged_nil 0

  done.set!
end
to_sexp() click to toggle source
# File lib/rubinius/code/ast/operators.rb, line 99
def to_sexp
  [:not, @value.to_sexp]
end