From 9e07e0602cfc3803a510acc1212e84dd19ac0b2f Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Thu, 20 Mar 2025 09:35:45 +0100
Subject: [PATCH] updated the naming patterns for the artificial emits and
 takes to "t:" and "e:" -> this is to avoid an effet de bord where it created
 an error

---
 src/emitted.py     | 4 ++--
 src/operation.py   | 8 +++++---
 src/subworkflow.py | 6 +++---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/emitted.py b/src/emitted.py
index b5c93ed..946ac4a 100644
--- a/src/emitted.py
+++ b/src/emitted.py
@@ -46,8 +46,8 @@ class Emitted(Channel):
         
         for o in emitted:
             code = o.get_code()
-            if(code[:len("emit:")]=="emit:"):
-                code =code[len("emit:"):].strip()
+            if(code[:len("e:")]=="e:"):
+                code =code[len("e:"):].strip()
             if(name==code):
                 self.emits = o
             else:
diff --git a/src/operation.py b/src/operation.py
index 1c83604..f58c833 100644
--- a/src/operation.py
+++ b/src/operation.py
@@ -712,11 +712,13 @@ class Operation(Executor):
                 if(temp==code):
                     raise Exception("This souldn't happen")
         
-        #Remove "emit:" and "takes:" for the subworkklfow inputs and outputs
-        if(remove_emit_and_take and code[:6] in ["emit: ", "take: "]):
-            code = code[6:]
+        #Remove "e:" and "t:" for the subworkklfow inputs and outputs
+        if(remove_emit_and_take and code[:6] in ["e: ", "t: "] and self.get_artificial_status()):
+            #print("-", code)
+            code = code[3:]
             code = code.strip()
             
+            
         return code
     
     def initialise_double_dot(self):
diff --git a/src/subworkflow.py b/src/subworkflow.py
index 1f8bb5e..b107bb3 100644
--- a/src/subworkflow.py
+++ b/src/subworkflow.py
@@ -219,7 +219,7 @@ class Subworkflow(Main):
                     #In the case the channel doesn't exist
                     if(channel==None):
                         from .operation import Operation
-                        ope = Operation(f"take: {code[i]}", self)
+                        ope = Operation(f"t: {code[i]}", self)
                         ope.set_as_artificial()
                         from .channel import Channel
                         channel = Channel(code[i], self)
@@ -250,7 +250,7 @@ class Subworkflow(Main):
                     if(channels==[]):
                         channels = self.root.get_channels_from_name_other_blocks_on_same_level(code[i])
                     if(channels!=[]):
-                        ope = Operation(code=f"emit: {code[i]}", origin=self)
+                        ope = Operation(code=f"e: {code[i]}", origin=self)
                         ope.set_as_artificial()
                         for channel in channels:
                             ope.add_element_origins(channel)
@@ -262,7 +262,7 @@ class Subworkflow(Main):
                         #Case it's an operation 
                         operation = Operation(code[i], self)
                         operation.initialise()
-                        operation.change_code(f"emit: {code[i]}")
+                        operation.change_code(f"e: {code[i]}")
                         operation.set_as_artificial()
                         tab.append(operation)
                         #operation.add_gives(channel)
-- 
GitLab