Skip to content

Commit 85a42fa

Browse files
committed
Revert "Fix params inclusion across modules in v2 parser (#6766)"
This reverts commit f5b8d32.
1 parent f381636 commit 85a42fa

File tree

2 files changed

+1
-55
lines changed

2 files changed

+1
-55
lines changed

modules/nextflow/src/test/groovy/nextflow/script/ScriptIncludesTest.groovy

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,33 +1190,4 @@ class ScriptIncludesTest extends Dsl2Spec {
11901190
then:
11911191
result == 'dlrow olleH'
11921192
}
1193-
1194-
def 'should load current params in included module' () {
1195-
given:
1196-
def folder = Files.createTempDirectory('test')
1197-
1198-
folder.resolve('main.nf').text = '''
1199-
params.outdir = "results"
1200-
1201-
include { echoParams } from './module.nf'
1202-
1203-
workflow {
1204-
echoParams()
1205-
}
1206-
'''
1207-
1208-
folder.resolve('module.nf').text = '''
1209-
def echoParams() {
1210-
return params
1211-
}
1212-
'''
1213-
1214-
when:
1215-
def result = runScript(folder.resolve('main.nf'))
1216-
then:
1217-
result == [outdir: 'results']
1218-
1219-
cleanup:
1220-
folder?.deleteDir()
1221-
}
12221193
}

modules/nf-lang/src/main/java/nextflow/script/control/ScriptToGroovyVisitor.java

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package nextflow.script.control;
1717

1818
import java.util.Arrays;
19-
import java.util.Comparator;
2019
import java.util.List;
2120
import java.util.Set;
2221
import java.util.stream.Collectors;
@@ -29,7 +28,6 @@
2928
import nextflow.script.ast.OutputBlockNode;
3029
import nextflow.script.ast.ParamBlockNode;
3130
import nextflow.script.ast.ParamNodeV1;
32-
import nextflow.script.ast.ProcessNode;
3331
import nextflow.script.ast.ProcessNodeV1;
3432
import nextflow.script.ast.ProcessNodeV2;
3533
import nextflow.script.ast.ScriptNode;
@@ -86,30 +84,7 @@ protected SourceUnit getSourceUnit() {
8684
public void visit() {
8785
if( moduleNode == null )
8886
return;
89-
90-
var declarations = moduleNode.getDeclarations();
91-
92-
declarations.sort(Comparator.comparing(node -> node.getLineNumber()));
93-
94-
for( var decl : declarations ) {
95-
if( decl instanceof FeatureFlagNode ffn )
96-
visitFeatureFlag(ffn);
97-
else if( decl instanceof FunctionNode fn )
98-
visitFunction(fn);
99-
else if( decl instanceof IncludeNode in )
100-
visitInclude(in);
101-
else if( decl instanceof OutputBlockNode obn )
102-
visitOutputs(obn);
103-
else if( decl instanceof ParamBlockNode pbn )
104-
visitParams(pbn);
105-
else if( decl instanceof ParamNodeV1 pn )
106-
visitParamV1(pn);
107-
else if( decl instanceof ProcessNode pn )
108-
visitProcess(pn);
109-
else if( decl instanceof WorkflowNode wn )
110-
visitWorkflow(wn);
111-
}
112-
87+
super.visit(moduleNode);
11388
if( moduleNode.isEmpty() )
11489
moduleNode.addStatement(ReturnStatement.RETURN_NULL_OR_VOID);
11590
}

0 commit comments

Comments
 (0)