Skip to content

Commit

Permalink
feat: add support for new exclude expressions in use rule statements
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Jul 19, 2022
1 parent 3dbd524 commit 9f03019
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snakefmt/parser/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ def validate_userule_syntax(self, snakefile: TokenIterator):
identifier = r"[a-zA-Z_]\S*"
use_syntax_regexp = (
r"use rule (?:(?:{id})|\*)"
r"(?: from {id})?(?: as {id})?( with[ ]?:)?$".format(id=identifier)
r"(?: from {id})?(?: exclude {id}( *, *{id})*)?(?: as {id})?( with[ ]?:)?$".format(id=identifier)
)
use_ebnf_syntax = (
'"use" "rule" (identifier | "*") '
'"from" identifier ["as" identifier] ["with" ":"]'
'"from" identifier ["exclude" identifier {"," identifier}] ["as" identifier] ["with" ":"]'
)
while not is_newline(self.token):
if self.token.type == tokenize.COMMENT:
Expand Down

0 comments on commit 9f03019

Please sign in to comment.