Class: TRuby::IR::VariableRef

Inherits:
Node
  • Object
show all
Defined in:
lib/t_ruby/ir.rb

Overview

Variable reference

Instance Attribute Summary collapse

Attributes inherited from Node

#location, #metadata, #type_info

Instance Method Summary collapse

Methods inherited from Node

#accept, #children, #transform

Constructor Details

#initialize(name:, scope: :local, **opts) ⇒ VariableRef

scope: :local, :instance, :class, :global



185
186
187
188
189
# File 'lib/t_ruby/ir.rb', line 185

def initialize(name:, scope: :local, **opts)
  super(**opts)
  @name = name
  @scope = scope
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



182
183
184
# File 'lib/t_ruby/ir.rb', line 182

def name
  @name
end

#scopeObject

Returns the value of attribute scope.



182
183
184
# File 'lib/t_ruby/ir.rb', line 182

def scope
  @scope
end