Skip to content

Commit

Permalink
feat: include if tokens to be cascaded with others
Browse files Browse the repository at this point in the history
  • Loading branch information
pheetah committed Dec 24, 2023
1 parent 2a370b3 commit d7b01fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def _handle_if(self, sequence: TokenSequence, depth=0) -> EpcNode:
if_node = copy.deepcopy(IfNode(uuid4()))
current_branch = copy.deepcopy(EpcDiagram())

self._handle_flow(token=first_element, diagram=current_branch)

depth_inner_processed_index = None
depth_latest_index = None

Expand All @@ -113,12 +115,12 @@ def _handle_if(self, sequence: TokenSequence, depth=0) -> EpcNode:
current_branch.push(depth_if)
continue

self._handle_flow(token=token, diagram=current_branch)

if Keywords.ELSE in token:
if_node.branches.append(current_branch.head)
current_branch = EpcDiagram()

self._handle_flow(token=token, diagram=current_branch)

if Keywords.ENDIF in token:
if_node.branches.append(current_branch.head)
return index + 1, if_node
Expand Down

0 comments on commit d7b01fd

Please sign in to comment.