Class: Highway::Compiler::Analyze::Tree::Values::Primitive

Inherits:
Base
  • Object
show all
Defined in:
lib/highway/compiler/analyze/tree/values/primitive.rb

Overview

This class represents a primitive value in the semantic tree. It consists of an array of segments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#select_segments, #select_variable_segments, #select_variable_segments_with_scope

Constructor Details

#initialize(segments) ⇒ Primitive

Initialize an instance.

Parameters:



23
24
25
# File 'lib/highway/compiler/analyze/tree/values/primitive.rb', line 23

def initialize(segments)
  @segments = segments
end

Instance Attribute Details

#segmentsArray<Highway::Compiler::Analyze::Tree::Segments::*> (readonly) Also known as: flatten_segments

The array of segments.



30
31
32
# File 'lib/highway/compiler/analyze/tree/values/primitive.rb', line 30

def segments
  @segments
end