class Bake::ErrorParser

Constants

SEVERITY_ERROR
SEVERITY_INFO
SEVERITY_OK
SEVERITY_WARNING

Public Instance Methods

get_severity(str) click to toggle source
# File lib/bake/toolchain/errorparser/error_parser.rb, line 24
def get_severity(str)
  if str.downcase == "info" || str.downcase == "note" || str.downcase == "remark"
    SEVERITY_INFO
  elsif str.downcase == "warning"
    SEVERITY_WARNING
  else
    SEVERITY_ERROR
  end
end
get_tasking_severity(str) click to toggle source
# File lib/bake/toolchain/errorparser/error_parser.rb, line 34
def get_tasking_severity(str)
  return SEVERITY_INFO if str.start_with?"R"
  return SEVERITY_WARNING if str.start_with?"W"
  return SEVERITY_ERROR  # F,E and S
end
inv_severity(s) click to toggle source
# File lib/bake/toolchain/errorparser/error_parser.rb, line 40
def inv_severity(s)
  if s == SEVERITY_INFO
    "info"
  elsif s == SEVERITY_WARNING
    "warning"
  elsif s == SEVERITY_ERROR
    "error"
  else
    raise "Unknown severity: #{s}"
  end
end
makeVsError(line, d) click to toggle source
# File lib/bake/toolchain/errorparser/error_parser.rb, line 64
def makeVsError(line, d)
  if d.file_name == nil
    return line
  end

  ret = d.file_name
  ret = ret + "(" + d.line_number.to_s + ")" if (d.line_number and d.line_number > 0)
  ret = ret + ": " + inv_severity(d.severity) + ": " + d.message
  return ret
end
scan(consoleOutput, proj_dir) click to toggle source
# File lib/bake/toolchain/errorparser/error_parser.rb, line 20
def scan(consoleOutput, proj_dir)
  raise "Use specialized classes only"
end
scan_lines(consoleOutput, proj_dir) click to toggle source

scan the output from the console line by line and return a list of ErrorDesc objects. for none-error/warning lines the description object will indicate that as severity 255 for single line errors/warnings: description will contain severity, line-number, message and file-name

for multi-line errors/warnings:

one description object for each line, first one will contain all single line error information,
all following desc.objects will just repeat the severity and include the message
# File lib/bake/toolchain/errorparser/error_parser.rb, line 60
def scan_lines(consoleOutput, proj_dir)
  raise "Use specialized classes only"
end