Class: Foxtail::Syntax::Parser::AST::Pattern

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

Overview

Represents a message or term value pattern consisting of text elements and placeables (expressions within braces)

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(elements) ⇒ Pattern

Returns a new instance of Pattern.



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

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

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



10
11
12
# File 'lib/foxtail/syntax/parser/ast/pattern.rb', line 10

def elements
  @elements
end

Instance Method Details

#childrenObject



17
# File 'lib/foxtail/syntax/parser/ast/pattern.rb', line 17

def children = elements