class Fable::VariablePointerValue

Attributes

context_index[RW]

Where the variable is located -1 = default, unknown, to be determined 0 = in global scope 1+ = callstack element index + 1 (so that the first doesn't conflict with special global scope)

Public Class Methods

new(variable_name=nil, context_index = -1) click to toggle source
Calls superclass method Fable::Value::new
# File lib/fable/value.rb, line 239
def initialize(variable_name=nil, context_index = -1)
  super(variable_name)
  self.context_index = context_index
end

Public Instance Methods

cast(new_type) click to toggle source
# File lib/fable/value.rb, line 244
def cast(new_type)
  if new_type == self.class
    return self
  end

  raise bad_cast_exception(new_type)
end
copy() click to toggle source
# File lib/fable/value.rb, line 256
def copy
  return VariablePointerValue.new(variable_name, context_index)
end
to_s() click to toggle source
# File lib/fable/value.rb, line 252
def to_s
  return "VariablePointerValue(#{variable_name})"
end
truthy?() click to toggle source
# File lib/fable/value.rb, line 235
def truthy?
  raise Error, "Shouldn't be checking the truthiness of a variable pointer"
end
value_type() click to toggle source
# File lib/fable/value.rb, line 231
def value_type
  return OrderedValueTypes[VariablePointerValue]
end