Skip to content
Snippets Groups Projects
Commit 55ae000f authored by George Marchment's avatar George Marchment
Browse files

Updated tthe rewrite of emits inside a subworkflow

parent 1faf59fd
No related branches found
No related tags found
No related merge requests found
Pipeline #14527 failed with stage
in 2 minutes and 36 seconds
...@@ -123,17 +123,30 @@ class Subworkflow(Main): ...@@ -123,17 +123,30 @@ class Subworkflow(Main):
for e in self.emit: for e in self.emit:
if(len(e.gives)==1): if(len(e.gives)==1):
ch = e.gives[0] ch = e.gives[0]
temp = code_after_emit if(ch.get_type()=="Channel"):
code_after_emit = replace_group1(code_after_emit, fr"[^\w]({re.escape(ch.get_code())})[^\w]", f"{ch.get_code()}_{name}") temp = code_after_emit
if(temp==code_after_emit): code_after_emit = replace_group1(code_after_emit, fr"[^\w]({re.escape(ch.get_code())})[^\w]", f"{ch.get_code()}_{name}")
raise Exception("This shoudn't happen -> code hasn't been replaced") if(temp==code_after_emit):
raise Exception("This shoudn't happen -> code hasn't been replaced")
elif(ch.get_type()=="Emitted"):
#Case it's an emitted -> we don't change anything -> it is already unique (since the ID has been added to the call)
None
else:
raise Exception("This shouldn't happen")
else: else:
ch = e.origins[0] ch = e.origins[0]
temp = code_after_emit if(ch.get_type()=="Channel"):
code_after_emit = replace_group1(code_after_emit, fr"[^\w]({re.escape(ch.get_code())})[^\w]", f"{ch.get_code()}_{name}") temp = code_after_emit
code_up_to_emit+=f"\n{ch.get_code()}_{name} = {ch.get_code()}" code_after_emit = replace_group1(code_after_emit, fr"[^\w]({re.escape(ch.get_code())})[^\w]", f"{ch.get_code()}_{name}")
if(temp==code_after_emit): code_up_to_emit+=f"\n{ch.get_code()}_{name} = {ch.get_code()}"
raise Exception("This shoudn't happen -> code hasn't been replaced") if(temp==code_after_emit):
raise Exception("This shoudn't happen -> code hasn't been replaced")
elif(ch.get_type()=="Emitted"):
#Case it's an emitted -> we don't change anything -> it is already unique (since the ID has been added to the call)
None
else:
raise Exception("This shouldn't happen")
#In the emits replacing the 'ch = ....' by 'ch' and adding 'ch = ....' at the end of the body #In the emits replacing the 'ch = ....' by 'ch' and adding 'ch = ....' at the end of the body
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment