Class: Highway::Compiler::Analyze::Tree::Segments::Variable
- Inherits:
-
Object
- Object
- Highway::Compiler::Analyze::Tree::Segments::Variable
- Defined in:
- lib/highway/compiler/analyze/tree/segments/variable.rb
Overview
This class represents a variable value segment in the semantic tree. It consists of a variable name and its lookup scope.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The variable name.
-
#scope ⇒ Symbol
readonly
The lookup scope of the variable.
Instance Method Summary collapse
-
#initialize(name, scope:) ⇒ Variable
constructor
Initialize an instance.
Constructor Details
#initialize(name, scope:) ⇒ Variable
Initialize an instance.
22 23 24 25 |
# File 'lib/highway/compiler/analyze/tree/segments/variable.rb', line 22 def initialize(name, scope:) @name = name @scope = scope end |
Instance Attribute Details
#name ⇒ String (readonly)
The variable name.
30 31 32 |
# File 'lib/highway/compiler/analyze/tree/segments/variable.rb', line 30 def name @name end |
#scope ⇒ Symbol (readonly)
The lookup scope of the variable.
35 36 37 |
# File 'lib/highway/compiler/analyze/tree/segments/variable.rb', line 35 def scope @scope end |