diff --git a/src/bioflowinsighterror.py b/src/bioflowinsighterror.py index 83ca4b7f3f5e5fa3d59e772f6897640d4359f780..d76b2965374b5c431d4c19ce01f027d0e5c583bc 100644 --- a/src/bioflowinsighterror.py +++ b/src/bioflowinsighterror.py @@ -41,6 +41,8 @@ class BioFlowInsightError(Exception): #* [1] -> presence of an import java or groovy (NOT USED RIGHT NOW) #* [3] -> unkonwn thing in a pipe operator #* [5] -> A ternary conditional operator was used with an tuple +#* [7] -> Tuple with emit (ch1, ch2) = emit.out + diff --git a/src/constant.py b/src/constant.py index 9411239cd88cf34ed7ade5fedda0aaa1ecfc4436..5c11ebce0459a71cba3becd2ccd986d06b280465 100644 --- a/src/constant.py +++ b/src/constant.py @@ -66,6 +66,7 @@ EMIT_EQUALS = r"\w+\s*=\s*((\w+)\s*\.\s*(output|out))[^\w]" EMIT_NAME = r'(\w+)\s*\.\s*(output|out)\s*\.\s*(\w+)' EMIT_OPERATION = r"(\w+)\s*\.\s*(output|out)\s*[^\w]" EMIT_TAB = r'(\w+)\s*\.\s*(output|out)\s*\[\s*(\d+)\s*\]' +TUPLE_EMIT = r'\( *\w+( *\, *\w+)+ *\) *= *'+EMIT_ALONE # FUNCTION diff --git a/src/operation.py b/src/operation.py index 11a5503a48cf093f44b1de65f705e87c7d49bcfc..b5e0da1d0435d7ab593c1b73f4e4f70efa02c684 100644 --- a/src/operation.py +++ b/src/operation.py @@ -364,6 +364,15 @@ class Operation(Executor): if(bool(re.fullmatch(constant.WORD, name))): self.add_origin(name) + #================================ + #Case (ch1, ch2, ...) = emit.out + #================================ + pattern= constant.TUPLE_EMIT + for match in re.finditer(pattern, operation): + raise BioFlowInsightError(f"A tuple is associated with an emit{self.get_string_line(self.get_code(clean_pipe = False))}. BioFlow-Insight doesn't support this (see specification list), try defining the operation in a different way.", num=7, origin=self) + + + #================================ #Case (ch1, ch2, ...) = channel.something #================================