Class: Foxtail::Syntax::Parser::AST::VariableReference

Inherits:
SyntaxNode show all
Defined in:
lib/foxtail/syntax/parser/ast/variable_reference.rb

Overview

Represents references to variables passed as arguments (e.g., $variable)

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#span

Attributes inherited from BaseNode

#type

Instance Method Summary collapse

Methods inherited from SyntaxNode

#add_span

Methods inherited from BaseNode

#==, #accept, #to_h

Constructor Details

#initialize(id) ⇒ VariableReference

Returns a new instance of VariableReference.



11
12
13
14
# File 'lib/foxtail/syntax/parser/ast/variable_reference.rb', line 11

def initialize(id)
  super()
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/foxtail/syntax/parser/ast/variable_reference.rb', line 9

def id
  @id
end

Instance Method Details

#childrenObject



16
# File 'lib/foxtail/syntax/parser/ast/variable_reference.rb', line 16

def children = [id]