Class: Taoism::Lexer::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/taoism/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorHandler

Returns a new instance of ErrorHandler.



262
263
264
# File 'lib/taoism/lexer.rb', line 262

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



260
261
262
# File 'lib/taoism/lexer.rb', line 260

def errors
  @errors
end

Instance Method Details

#add(code, message = "", pos = nil) ⇒ Object



266
267
268
# File 'lib/taoism/lexer.rb', line 266

def add(code, message = "", pos = nil)
  @errors << LexicalError.new(code, message, pos)
end