class Atomy::Code::Constant

Attributes

name[R]
parent[R]

Public Class Methods

new(name, parent = nil) click to toggle source
# File lib/atomy/code/constant.rb, line 6
def initialize(name, parent = nil)
  @name = name
  @parent = parent
end

Public Instance Methods

bytecode(gen, mod) click to toggle source
# File lib/atomy/code/constant.rb, line 11
def bytecode(gen, mod)
  if @parent
    mod.compile(gen, @parent)
    gen.find_const(@name)
  else
    gen.push_const(@name)
  end
end