Class: Violet::ParserError

Inherits:
Error
  • Object
show all
Defined in:
lib/violet/parser.rb

Overview

Internal: Records errors emitted by the parser.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, token) ⇒ ParserError

Public: Creates a new ‘ParserError`.

message - The error message. token - The malformed ‘Token`.



13
14
15
16
# File 'lib/violet/parser.rb', line 13

def initialize(message, token)
  @token = token
  super message
end

Instance Attribute Details

#tokenObject (readonly)

Public: Gets the malformed ‘Token` associated with this error.



7
8
9
# File 'lib/violet/parser.rb', line 7

def token
  @token
end