From 8a5e87ad048c4b3d974a17cd9fc1d3bdb21c0085 Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Tue, 6 Feb 2024 18:41:41 +0100
Subject: [PATCH] Fix minor bug

---
 src/constant.py  | 1 +
 src/operation.py | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/constant.py b/src/constant.py
index fee907b..9411239 100644
--- a/src/constant.py
+++ b/src/constant.py
@@ -106,6 +106,7 @@ DOUBLE_DOT = r"(\w+)\s*=\s*([^\?\n]+)\s*\?([^\n]+)"
 DOUBLE_DOT_TUPLE = r"\(\s*\w+\s*(,\s*\w+\s*)+\)\s*=\s*([^\?\n]+)\s*\?([^\n]+)"
 END_OPERATOR = r' *(\(|{)'
 ILLEGAL_CHARCTER_BEFORE_POTENTIAL_CHANNELS = r"\w|\'|\"|\."
+ILLEGAL_CHARCTER_AFTER_POTENTIAL_CHANNELS = r"\w"
 MERGE_OPERATIONS = r'\.\s*((merge|mix|concat|spread|join|phase|cross|combine|fromList|collect|fromPath|value|from)\s*(\(|\{))'
 OPERATOR_IN_PIPE = r"\w+ *{[^}]*}|\w+ *\([^\)]*\)|\w+"
 SET_OPERATORS = ["choice", "separate", "tap", "into", "set"]
diff --git a/src/operation.py b/src/operation.py
index 00244d6..ff93b0d 100644
--- a/src/operation.py
+++ b/src/operation.py
@@ -437,8 +437,11 @@ class Operation(Executor):
                                 to_add = True
                                 for p in pos:
                                     if(p>0):
+                                        #Check it is actually the channel and not a different channel
                                         if(bool(re.fullmatch(constant.ILLEGAL_CHARCTER_BEFORE_POTENTIAL_CHANNELS, operation[p-1]))):
                                             to_add = False
+                                        if(bool(re.fullmatch(constant.ILLEGAL_CHARCTER_AFTER_POTENTIAL_CHANNELS, operation[p+len(c.get_name())]))):
+                                            to_add = False
                                 if(to_add):
                                     self.add_origin(c.get_name())
                         #TODO update this -> it's an operation itselfs
-- 
GitLab