lib/distil/error-reporter.rb in distil-0.12.3 vs lib/distil/error-reporter.rb in distil-0.12.4

- old
+ new

@@ -2,19 +2,29 @@ module ErrorReporter @@warning_count=0 @@error_count=0 @@ignore_warnings= false + @@total_warning_count=0 + @@total_error_count=0 def ignore_warnings @@ignore_warnings end def ignore_warnings=(ignore) @@ignore_warnings=ignore end + def total_error_count + @@total_error_count + end + + def total_warning_count + @@total_warning_count + end + def self.error(message, file=nil, line_number=nil) @@error_count+=1 if (file && line_number) printf("%s:%d: error: %s\n", file, line_number, message) else @@ -52,9 +62,11 @@ end def report puts "\n" if (@@error_count>0 || @@warning_count>0) puts "#{@@error_count} error(s), #{@@warning_count} warning(s)#{ignore_warnings ? " ignored" : ""}" + @@total_error_count += @@error_count + @@total_warning_count += @@warning_count @@error_count=0 @@warning_count=0 end end