Class: Foxtail::Syntax::Parser::AST::Annotation

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

Overview

Represents parser error annotations with code, arguments, and message

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, #children, #to_h

Constructor Details

#initialize(code, arguments = [], message = "") ⇒ Annotation

Returns a new instance of Annotation.



13
14
15
16
17
18
# File 'lib/foxtail/syntax/parser/ast/annotation.rb', line 13

def initialize(code, arguments=[], message="")
  super()
  @code = code
  @arguments = arguments
  @message = message
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#messageObject

Returns the value of attribute message.



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

def message
  @message
end