<commit_before>require 'cxxproject/errorparser/error_parser'

module Cxxproject
  class GCCCompilerErrorParser < ErrorParser

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


    def scan_lines(consoleOutput, proj_dir)
      res = []
      consoleOutput.each_line do |l|
        d = ErrorDesc.new
        scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
        if scan_res.length > 0
          d.file_name = File.expand_path(scan_res[0][0])
          d.line_number = scan_res[0][1].to_i
          d.message = scan_res[0][4]
          d.severity = get_severity(scan_res[0][3])
        end<commit_msg>Fixed warning for regex in ruby 1.8.6<commit_after>require 'cxxproject/errorparser/error_parser'

module Cxxproject
  class GCCCompilerErrorParser < ErrorParser

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

    def scan_lines(consoleOutput, proj_dir)
      res = []
      consoleOutput.each_line do |l|
        d = ErrorDesc.new
        scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
        if scan_res.length > 0
          d.file_name = File.expand_path(scan_res[0][0])
          d.line_number = scan_res[0][1].to_i
          d.message = scan_res[0][4]
          d.severity = get_severity(scan_res[0][3])
        end
{'fraction_non_alphanumeric': 0.15982721382289417, 'fraction_numerical': 0.02087832973362131, 'mean_word_length': 2.736559139784946, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4736510', 'n_tokens_mistral': 519, 'n_tokens_neox': 494, 'n_words': 83}