Class: Fable::VariableAssignment

Inherits:
RuntimeObject show all
Defined in:
lib/fable/variable_assignment.rb

Overview

The value to be assigned is popped off the evaluation stack, so no need to keep it here

Instance Attribute Summary collapse

Attributes inherited from RuntimeObject

#original_object, #own_debug_metadata, #parent, #path

Instance Method Summary collapse

Methods inherited from RuntimeObject

#compact_path_string, #convert_path_to_relative, #copy, #debug_line_number_of_path, #debug_metadata, #indentation_string, #resolve_path, #root_content_container

Constructor Details

#initialize(variable_name, new_declaration) ⇒ VariableAssignment

Returns a new instance of VariableAssignment.



10
11
12
13
14
# File 'lib/fable/variable_assignment.rb', line 10

def initialize(variable_name, new_declaration)
  super()
  self.variable_name = variable_name
  self.new_declaration = new_declaration
end

Instance Attribute Details

#globalObject Also known as: global?

Returns the value of attribute global.



5
6
7
# File 'lib/fable/variable_assignment.rb', line 5

def global
  @global
end

#new_declarationObject Also known as: new_declaration?

Returns the value of attribute new_declaration.



5
6
7
# File 'lib/fable/variable_assignment.rb', line 5

def new_declaration
  @new_declaration
end

#variable_nameObject

Returns the value of attribute variable_name.



5
6
7
# File 'lib/fable/variable_assignment.rb', line 5

def variable_name
  @variable_name
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/fable/variable_assignment.rb', line 16

def to_s
  return "VarAssign to #{variable_name}"
end