@@ -96,19 +96,19 @@ def main_nf(
9696 for line in iter_lines :
9797 if re .search (r"^\s*process\s*\w*\s*{" , line ) and state == "module" :
9898 state = "process"
99- if re .search (r"input\s*:" , line ) and state in ["process" ]:
99+ if re .search (r"^\s* input\s*:" , line ) and state in ["process" ]:
100100 state = "input"
101101 continue
102- if re .search (r"output\s*:" , line ) and state in ["input" , "process" ]:
102+ if re .search (r"^\s* output\s*:" , line ) and state in ["input" , "process" ]:
103103 state = "output"
104104 continue
105- if re .search (r"when\s*:" , line ) and state in ["input" , "output" , "process" ]:
105+ if re .search (r"^\s* when\s*:" , line ) and state in ["input" , "output" , "process" ]:
106106 state = "when"
107107 continue
108- if re .search (r"script\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
108+ if re .search (r"^\s* script\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
109109 state = "script"
110110 continue
111- if re .search (r"shell\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
111+ if re .search (r"^\s* shell\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
112112 state = "shell"
113113 continue
114114
0 commit comments