Sha256: 2f61115714aa2d08ee69d6a3d106e531972ed2149422d194c2d89add4453b4ae

Contents?: true

Size: 1.31 KB

Versions: 48

Compression:

Stored size: 1.31 KB

Contents

require_relative 'error_parser'

module Bake
  class DiabCompilerErrorParser < ErrorParser

    def initialize()
      @error_expression_start = /\"(.+)\", line ([0-9]+): (?!included)(catastrophic |fatal )*([A-Za-z]+)[:]* (.+)/
      @error_expression_end = /^[ \t]*\^/ # well, it may end without "^"... in this case the error will last the next one starts or console text ends
    end

    def scan_lines(consoleOutput, proj_dir)
      res = []
      error_severity = 255
      consoleOutputFullnames = ""
      consoleOutput[0].each_line do |l|
        d = ErrorDesc.new
        lstripped = l.rstrip
        scan_res = lstripped.scan(@error_expression_start)
        if scan_res.length == 0
          d.severity = error_severity
          d.message = lstripped
          if lstripped.scan(@error_expression_end).length > 0
            error_severity = 255
          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][4]
          d.severity = get_severity(scan_res[0][3])
          error_severity = d.severity
          l.gsub!(scan_res[0][0],d.file_name)
        end
        res << d
        consoleOutputFullnames << l
      end
      [res, consoleOutputFullnames]
    end

  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

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