Navigation Menu

Skip to content

Commit

Permalink
fix: parsing error when combining single line directive with multi-li…
Browse files Browse the repository at this point in the history
…ne directive in use rule statements (#1662)

* fix: parsing error when combining single line directive with multi-line directive in use rule statements

* set number of cores to be high enough for test case result to be correct

* skip test on win
  • Loading branch information
johanneskoester committed May 18, 2022
1 parent bbed20f commit 26e57d6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion snakemake/parser.py
Expand Up @@ -1129,7 +1129,7 @@ def block_content(self, token):
)
except StopAutomaton as e:
self.indentation(e.token)
self.block(e.token)
yield from self.block(e.token)
else:
self.error(
"Expecting a keyword or comment "
Expand Down
19 changes: 19 additions & 0 deletions tests/test_github_issue1618/Snakefile
@@ -0,0 +1,19 @@
rule all:
input:
"test2.out",


rule a:
output:
"test.out",
threads: 4
shell:
"""
echo {threads} > {output}
"""


use rule a as b with:
threads: 5
output:
"test2.out",
1 change: 1 addition & 0 deletions tests/test_github_issue1618/expected-results/test2.out
@@ -0,0 +1 @@
5
5 changes: 5 additions & 0 deletions tests/tests.py
Expand Up @@ -1644,3 +1644,8 @@ def test_rule_inheritance_globals():

def test_retries():
run(dpath("test_retries"))


@skip_on_windows # sufficient to test this on linux
def test_github_issue1618():
run(dpath("test_github_issue1618"), cores=5)

0 comments on commit 26e57d6

Please sign in to comment.