Module: ErrorMessages

Included in:
Parser, Tokenizer
Defined in:
lib/lisp/interpreter/core/errors.rb

Overview

ErrorMessages module contains different error messages

Instance Method Summary collapse

Instance Method Details

#arg_err_build(exp, got) ⇒ Object



11
12
13
# File 'lib/lisp/interpreter/core/errors.rb', line 11

def arg_err_build(exp, got)
  'Incorrect number of arguments, expected ' + exp.to_s + ' got ' + got.to_s
end

#no_procedure_build(name) ⇒ Object



15
16
17
# File 'lib/lisp/interpreter/core/errors.rb', line 15

def no_procedure_build(name)
  name.to_s + ' is not function'
end

#type_err(exp, got) ⇒ Object



23
24
25
# File 'lib/lisp/interpreter/core/errors.rb', line 23

def type_err(exp, got)
  'Invalid data type, expected ' + exp.to_s + ' got ' + got.to_s
end

#unbalanced_brackets_errorObject



3
4
5
# File 'lib/lisp/interpreter/core/errors.rb', line 3

def unbalanced_brackets_error
  'error signaled: unbalanced brackets'
end

#unbalanced_quotes_errorObject



7
8
9
# File 'lib/lisp/interpreter/core/errors.rb', line 7

def unbalanced_quotes_error
  'error signaled: unbalanced quotes'
end

#unbound_symbol_err(symbol) ⇒ Object



19
20
21
# File 'lib/lisp/interpreter/core/errors.rb', line 19

def unbound_symbol_err(symbol)
  'Unbound symbol ' + symbol.to_s
end