diff --git a/src/constant.py b/src/constant.py index fee907b785cc66e74817dbf85988064ddfbbaa4c..9411239cd88cf34ed7ade5fedda0aaa1ecfc4436 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 00244d6a21d3434cecfc78ef4407844898c2fb86..ff93b0d83cd3a2612a136c63f67d0d0ca06cd4c5 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