class Error

Base class for throwing errors.

Public Class Methods

new(pos_start, pos_end, error_name, details) click to toggle source
# File lib/simpler_lexer/errors/error.rb, line 5
def initialize(pos_start, pos_end, error_name, details)
  @pos_start = pos_start
  @pos_end = pos_end
  @error_name = error_name
  @details = details
end

Public Instance Methods

as_string() click to toggle source
# File lib/simpler_lexer/errors/error.rb, line 12
def as_string
  result = "#{@error_name}: #{@details}\n"
  result += "File #{@pos_start}, line #{@pos_start}"
  result
end