Sha256: ce23c9617b9df50bcd058009b3ff3b5776ef24f6f42161f6be51f9a5fc74a59f

Contents?: true

Size: 1.34 KB

Versions: 42

Compression:

Stored size: 1.34 KB

Contents

require_relative 'error_parser'

module Bake
  class IARCompilerErrorParser < ErrorParser

    def initialize()
      @error_expression_start = /\"(.+)\",([0-9]+)\s+(internal |fatal )*([A-Za-z]+)([^:]*):\s*(.*)/
    end

    def scan_lines(consoleOutput, proj_dir)
      res = []
      error_severity = 255
      consoleOutputFullnames = ""
      lastValidErrorDesc = nil

      consoleOutput[0].each_line do |l|
        d = ErrorDesc.new
        lstripped = l.rstrip
        scan_res = lstripped.scan(@error_expression_start)
        if scan_res.length == 0
          if lastValidErrorDesc
            lastValidErrorDesc.message += l
            d.severity = lastValidErrorDesc.severity
          else
            d.severity = SEVERITY_OK
            d.message = lstripped
          end
          if lstripped == ""
            lastValidErrorDesc = nil
          end
        else
          d.file_name = File.expand_path(scan_res[0][0], proj_dir)
          d.line_number = scan_res[0][1].to_i
          d.message = scan_res[0][5]
          d.severity = get_severity(scan_res[0][3])
          error_severity = d.severity
          l.gsub!(scan_res[0][0],d.file_name)
          lastValidErrorDesc = d
        end
        res << d
        consoleOutputFullnames << l
      end
      [res, consoleOutputFullnames]
    end

  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
bake-toolkit-2.72.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.71.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.70.1 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.70.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.69.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.68.1 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.68.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.67.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.66.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.65.2 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.65.1 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.65.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.64.4 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.64.3 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.64.2 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.64.1 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.64.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.63.2 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.63.1 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
bake-toolkit-2.63.0 lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb