Class: Bake::IARLinkerErrorParser
- Inherits:
-
ErrorParser
- Object
- ErrorParser
- Bake::IARLinkerErrorParser
- Defined in:
- lib/bake/toolchain/errorparser/iar_linker_error_parser.rb
Constant Summary
Constants inherited from ErrorParser
ErrorParser::SEVERITY_ERROR, ErrorParser::SEVERITY_INFO, ErrorParser::SEVERITY_OK, ErrorParser::SEVERITY_WARNING
Instance Method Summary collapse
-
#initialize ⇒ IARLinkerErrorParser
constructor
A new instance of IARLinkerErrorParser.
- #scan_lines(consoleOutput, proj_dir) ⇒ Object
Methods inherited from ErrorParser
#get_severity, #get_tasking_severity, #inv_severity, #makeVsError, #scan
Constructor Details
#initialize ⇒ IARLinkerErrorParser
Returns a new instance of IARLinkerErrorParser.
6 7 8 |
# File 'lib/bake/toolchain/errorparser/iar_linker_error_parser.rb', line 6 def initialize() @error_expression = /([A-Za-z]+)\[\w+\]:\s*(.+)/ end |
Instance Method Details
#scan_lines(consoleOutput, proj_dir) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bake/toolchain/errorparser/iar_linker_error_parser.rb', line 10 def scan_lines(consoleOutput, proj_dir) res = [] lastValidErrorDesc = nil consoleOutput[0].each_line do |l| l.rstrip! d = ErrorDesc.new scan_res = l.scan(@error_expression) if scan_res.length > 0 d.file_name = proj_dir d.line_number = 0 d. = scan_res[0][1] d.severity = get_severity(scan_res[0][0]) error_severity = d.severity lastValidErrorDesc = d else if lastValidErrorDesc lastValidErrorDesc. += l.lstrip d.severity = lastValidErrorDesc.severity else d.severity = SEVERITY_ERROR end end res << d end [res, consoleOutput[0]] end |