1. Sean Davis
  2. Snakemake

Commits

Johannes Köster  committed 78e7581

Fixed comma detection and made token detection more robust.

  • Participants
  • Parent commits c39548e
  • Branches master

Comments (0)

Files changed (1)

File snakemake/parser.py

View file
  • Ignore whitespace
     return token.type == tokenize.DEDENT
 
 
+def is_op(token):
+    return token.type == tokenize.OP
+
+
 def is_greater(token):
-    return token.type == tokenize.OP and token.string == ">"
+    return is_op(token) and token.string == ">"
 
 
 def is_comma(token):
-    return token.type == tokenize.COMMA
+    return is_op(token) and token.string == ","
 
 
 def is_name(token):
 
 
 def is_colon(token):
-    return token.string == ":"
+    return is_op(token) and token.string == ":"
 
 
 def is_comment(token):