Class: SyntaxTree::SymBeg

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree.rb

Overview

SymBeg represents the beginning of a symbol literal.

:symbol

SymBeg is also used for dynamic symbols, as in:

:"symbol"

Finally, SymBeg is also used for symbols using the %s syntax, as in:

%s[symbol]

The value of this node is a string. In most cases (as in the first example above) it will contain just “:”. In the case of dynamic symbols it will contain “:‘” or “:"”. In the case of %s symbols, it will contain the start of the symbol including the %s and the delimiter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, location:) ⇒ SymBeg

Returns a new instance of SymBeg.



11501
11502
11503
11504
# File 'lib/syntax_tree.rb', line 11501

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



11499
11500
11501
# File 'lib/syntax_tree.rb', line 11499

def location
  @location
end

#valueObject (readonly)

String

the beginning of the symbol



11496
11497
11498
# File 'lib/syntax_tree.rb', line 11496

def value
  @value
end