Sha256: 2c33c2abd2c718052acc37313c1f98753864377d77d4549bcac553178510d84e

Contents?: true

Size: 1.21 KB

Versions: 37

Compression:

Stored size: 1.21 KB

Contents

require_relative 'error_parser'

module Bake
  class GCCCompilerErrorParser < ErrorParser

    def initialize()
      @error_expression =  /([^:]+):([0-9]+)[:0-9]* (catastrophic |fatal )*([A-Za-z\._]+): (.+)/
      @error_expression2 = /([^:]+)\(([0-9]+)\): (catastrophic |fatal )*([A-Za-z\._]+): (.+)/
    end

    def scan_lines(consoleOutput, proj_dir)
      res = []
      consoleOutputFullnames = ""
      consoleOutput[0].each_line do |l|
        d = ErrorDesc.new
        scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
        scan_res = l.gsub(/\r\n?/, "").scan(@error_expression2) if !(scan_res.length > 0)
        if scan_res.length > 0
          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][4]
          if (scan_res[0][3].include?".")
            d.severity = SEVERITY_ERROR
            d.message = scan_res[0][3] + ": " + d.message
          else
            d.severity = get_severity(scan_res[0][3])
          end
          l.gsub!(scan_res[0][0],d.file_name)
        end
        res << d
        consoleOutputFullnames << l
      end
      [res, consoleOutputFullnames]
    end

  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
bake-toolkit-2.62.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.61.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.60.2 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.60.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.59.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.58.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.57.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.56.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.55.1 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.55.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.54.3 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.54.2 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.54.1 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.54.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.53.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.52.1 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb
bake-toolkit-2.52.0 lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb