Class: Foxtail::Syntax::Parser::AST::Junk

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

Overview

Represents unparseable content with associated error annotations

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(content, annotations = []) ⇒ Junk

Returns a new instance of Junk.



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

def initialize(content, annotations=[])
  super()
  @content = content
  @annotations = annotations
end

Instance Attribute Details

#annotationsObject

Returns the value of attribute annotations.



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

def annotations
  @annotations
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#childrenObject



18
# File 'lib/foxtail/syntax/parser/ast/junk.rb', line 18

def children = annotations