class CodeTools::AST::Container

Attributes

file[RW]
name[RW]
pre_exe[RW]
variable_scope[RW]

Public Class Methods

new(body) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 1138
def initialize(body)
  @body = body || NilLiteral.new(1)
  @pre_exe = []
end

Public Instance Methods

container_bytecode(g) { || ... } click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 1151
def container_bytecode(g)
  g.name = @name
  g.file = @file.to_sym

  push_state(g)
  @pre_exe.each { |pe| pe.pre_bytecode(g) }

  yield if block_given?
  pop_state(g)

  g.local_count = local_count
  g.local_names = local_names
end
pop_state(g) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 1147
def pop_state(g)
  g.pop_state
end
push_state(g) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 1143
def push_state(g)
  g.push_state self
end
to_sexp() click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 1165
def to_sexp
  sexp = [sexp_name]
  @pre_exe.each { |pe| sexp << pe.pre_sexp }
  sexp << @body.to_sexp
  sexp
end