class Emfrp::Typing::TypeMatchingError
Public Class Methods
new(code, expected_utype, real_utype, place, *factors)
click to toggle source
# File lib/emfrp/typing/typing_error.rb, line 7 def initialize(code, expected_utype, real_utype, place, *factors) @code = code @expected_utype = expected_utype @real_utype = real_utype @place = place @factors = factors end
Public Instance Methods
code()
click to toggle source
# File lib/emfrp/typing/typing_error.rb, line 15 def code @code end
print_error(output_io, file_loader)
click to toggle source
# File lib/emfrp/typing/typing_error.rb, line 19 def print_error(output_io, file_loader) output_io << "[Type Matching Error]".colorize(:red) + ": For #{@place}:\n" output_io << "Expected: " + "#{@expected_utype.inspect}".colorize(:green) + "\n" output_io << "Real: " + "#{@real_utype.inspect}".colorize(:green) + "\n" @factors.each do |factor| print_lexical_factor(factor, output_io, file_loader) end end