Commit 8d86d771 authored by Robin Mueller's avatar Robin Mueller
Browse files

continued multi line event parser

parent 3259a6ec
......@@ -71,8 +71,30 @@ class EventParser(FileParser):
self.my_id = self.return_number_from_string(self.current_id)
# Now try to look for event definitions. Moving windows allows multi line event definitions
# These two variants need to be checked
# static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*event::makeEvent
# static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*MAKE_EVENT
event_match = re.match(
r"static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*event::makeEvent",
moving_window[self.moving_window_center_idx]
)
regex_string = r""
if not event_match:
event_match = re.match(
r"static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*MAKE_EVENT",
moving_window[self.moving_window_center_idx]
)
if event_match:
regex_string = \
r"static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*" \
r"event::makeEvent\(([0-9]{1,2}),[\s]*severity::([A-Z]*)\);[\t ]*(//!<)?([^\n]*)"
else:
regex_string = \
r"static const(?:expr)? Event[\s]*([A-Z_0-9]*)[\s]*=[\s]*" \
r"MAKE_EVENT\(([0-9]{1,2}),[\s]*severity::([A-Z]*)\);[\t ]*(//!<)?([^\n]*)"
if event_match:
if ";" in event_match.group(0):
# One line event definition.
event_full_match = re.search(regex_string, moving_window[self.moving_window_center_idx])
# Description will be parsed separately
description = " "
def _post_parsing_operation(self):
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment