Exception: Emfrp::Typing::TypeDetermineError

Inherits:
CompileError
  • Object
show all
Defined in:
lib/emfrp/typing/typing_error.rb

Instance Attribute Summary

Attributes inherited from CompileError

#factors, #message

Instance Method Summary collapse

Methods inherited from CompileError

#collect_factor_tags, #factor_name, #find_factor_file_name, #print_lexical_factor, #tag_comp

Constructor Details

#initialize(code, undetermined_utype, factor) ⇒ TypeDetermineError

Returns a new instance of TypeDetermineError.



30
31
32
33
34
# File 'lib/emfrp/typing/typing_error.rb', line 30

def initialize(code, undetermined_utype, factor)
  @code = code
  @utype = undetermined_utype
  @factor = factor
end

Instance Method Details

#codeObject



36
37
38
# File 'lib/emfrp/typing/typing_error.rb', line 36

def code
  @code
end


40
41
42
43
44
# File 'lib/emfrp/typing/typing_error.rb', line 40

def print_error(output_io, file_loader)
  output_io << "[Undetermined Type Error]".colorize(:red) + ":\n"
  output_io << "Undetermined: " + "#{@utype.inspect}".colorize(:green) + "\n"
  print_lexical_factor(@factor, output_io, file_loader)
end