Skip to content

Commit 08c1b04

Browse files
committed
Simplify ARMC6 parsing logic
1 parent cc4f337 commit 08c1b04

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

tools/toolchains/arm.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,10 @@ def is_not_supported_error(self, output):
624624
return "#error [NOT_SUPPORTED]" in output
625625

626626
def parse_output(self, output):
627-
msg = None
628627
for line in output.splitlines():
629628
match = self.LD_DIAGNOSTIC_PATTERN.match(line)
630629
if match is not None:
631-
if msg is not None:
632-
self.notify.cc_info(msg)
633-
msg = None
634-
msg = {
630+
self.notify.cc_info({
635631
'severity': match.group('severity').lower(),
636632
'message': match.group('message'),
637633
'text': '',
@@ -640,30 +636,10 @@ def parse_output(self, output):
640636
'col': 0,
641637
'file': "",
642638
'line': 0
643-
}
644-
elif msg is not None:
645-
# Determine the warning/error column by calculating the '^'
646-
# position
647-
match = ARM.INDEX_PATTERN.match(line)
648-
if match is not None:
649-
msg['col'] = len(match.group('col'))
650-
self.notify.cc_info(msg)
651-
msg = None
652-
else:
653-
msg['text'] += line+"\n"
654-
655-
if msg is not None:
656-
self.notify.cc_info(msg)
657-
658-
# The warning/error notification is multiline
659-
msg = None
660-
for line in output.splitlines():
639+
})
661640
match = self.DIAGNOSTIC_PATTERN.search(line)
662641
if match is not None:
663-
if msg is not None:
664-
self.notify.cc_info(msg)
665-
msg = None
666-
msg = {
642+
self.notify.cc_info({
667643
'severity': match.group('severity').lower(),
668644
'file': match.group('file'),
669645
'line': match.group('line'),
@@ -672,10 +648,7 @@ def parse_output(self, output):
672648
'text': '',
673649
'target_name': self.target.name,
674650
'toolchain_name': self.name
675-
}
676-
677-
if msg is not None:
678-
self.notify.cc_info(msg)
651+
})
679652

680653
def get_config_option(self, config_header):
681654
return ["-include", config_header]

0 commit comments

Comments
 (0)