Skip to content

Commit

Permalink
Фикс парсинга событий, если в действиях присутствует '/' (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
L140-beep authored Dec 22, 2024
1 parent 30f754c commit 29ee0b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion compiler/CGML.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ def __parse_actions(actions: str) -> List[InnerEvent]:
events: List[InnerEvent] = []
raw_events = actions.split('\n\n')
for raw_event in raw_events:
raw_trigger, do = raw_event.split('/')
parsed_event = re.search(
r'^(?P<event>[^\/]+)\/(?P<actions>.*)$', raw_event, flags=re.S)
if parsed_event is None:
continue
parsed_dict = parsed_event.groupdict()
raw_trigger: str | None = parsed_dict.get('event')
do: str | None = parsed_dict.get('actions')
if (do is None or raw_trigger is None):
continue
inner_trigger = __parse_trigger(
raw_trigger,
[
Expand Down

0 comments on commit 29ee0b0

Please sign in to comment.