diff --git a/src/constant.py b/src/constant.py index b672359a48e9900fed7b26d8c14efd5d7dd8d124..e1e55a52090db6c6ee5ed82382e71352c5ff2f5e 100644 --- a/src/constant.py +++ b/src/constant.py @@ -109,7 +109,7 @@ 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|map)\s*(\(|\{))'#I've added map to this list cause channels can appear in map can concatenating channels -> it's a strange way of doing it +MERGE_OPERATIONS = r'\.\s*((merge|mix|concat|spread|join|phase|cross|combine|fromList|collect|fromPath|value|from|map|fromFilePairs)\s*(\(|\{))'#I've added map to this list cause channels can appear in map can concatenating channels -> it's a strange way of doing it OPERATOR_IN_PIPE = r"\w+ *{[^}]*}|\w+ *\([^\)]*\)|\w+" SET_OPERATORS = ["choice", "separate", "tap", "into", "set"] TUPLE_EQUALS = r'\( *\w+( *, *\w+)+ *\) *=\s*(\w+)\s*\.' @@ -131,7 +131,7 @@ INTO = r'into +([\w, ]+)' INTO_2 = r'into +\(?( *\w+ *(, *\w+)*) *\)?' OUTPUT = r"\n\s*output *:" PROCESS_HEADER = r'process\s+(\w+|\'[\w ]+\'|\"[\w ]+\")\s*{' -SCRIPT = r"\n\s*script *:|shell *:|exec *:|\"\"\"|\'\'\'" +SCRIPT = r"\n\s*script *:|shell *:|exec *:|\"\"\"\s|\'\'\'\s" WHEN = r"\n\s*when *:" diff --git a/src/process.py b/src/process.py index c791e70a9d195da198eaf25502d799b144d41024..07ff0b129637b1cceff017203026bf8377dca6bd 100644 --- a/src/process.py +++ b/src/process.py @@ -419,6 +419,8 @@ class Process(Nextflow_Building_Blocks): self.name = match.group(1) self.name = self.name.replace("'", "") self.name = self.name.replace('"', '') + if(self.name=="process"): + raise Exception("Process is names 'process'") if(self.alias==""): self.alias = self.name self.printed_name = self.alias @@ -512,9 +514,17 @@ class Process(Nextflow_Building_Blocks): code = self.get_code() call = [f"{self.get_name()}({self.get_parameters_call()})"] if(self.input_code!=""): + temp = code code = code.replace(self.input_code, self.convert_input_code_to_DSL2()) + if(temp==code): + raise Exception("This souldn't happen") if(self.output_code!=""): + temp = code code = code.replace(self.output_code, self.convert_output_code_to_DSL2()) + if(temp==code): + print(f'"{self.output_code}"') + print(f'"{self.convert_output_code_to_DSL2()}"') + raise Exception("This souldn't happen") channels_to_flatten = self.get_channels_to_flatten()