Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)