summaryrefslogtreecommitdiff
path: root/snakemake-mode.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-04-16 17:03:07 -0400
committerKyle Meyer <kyle@kyleam.com>2016-04-16 17:03:07 -0400
commit5c9873c39222e8d54afc9e63d1148ae1a822fbda (patch)
treeff1d2f9490f534af45bd079321335a01cbd45d8f /snakemake-mode.el
parent66f0d242fa063277713e723d83d051402ff12e1d (diff)
downloadsnakemake-mode-5c9873c39222e8d54afc9e63d1148ae1a822fbda.tar.gz
Support anonymous rule blocks
Diffstat (limited to 'snakemake-mode.el')
-rw-r--r--snakemake-mode.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 319a0d8..56052d1 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -70,10 +70,11 @@
;;; Regexp
(defconst snakemake-rule-or-subworkflow-re
- (rx (group symbol-start (or "rule" "subworkflow"))
- " "
- (group (one-or-more (or (syntax word) (syntax symbol))))
- ":")
+ (rx (or (and (group symbol-start (or "rule" "subworkflow"))
+ " "
+ (group (one-or-more (or (syntax word) (syntax symbol))))
+ ":")
+ (and (group symbol-start "rule") ":")))
"Regexp matching a rule or subworkflow.")
(defconst snakemake-rule-or-subworkflow-line-re
@@ -326,8 +327,10 @@ label."
;;; Mode
(defvar snakemake-font-lock-keywords
- `((,snakemake-rule-or-subworkflow-line-re (1 font-lock-keyword-face)
- (2 font-lock-function-name-face))
+ `((,snakemake-rule-or-subworkflow-line-re
+ (1 font-lock-keyword-face nil 'lax)
+ (2 font-lock-function-name-face nil 'lax)
+ (3 font-lock-keyword-face nil 'lax))
(,snakemake-toplevel-command-re 1 font-lock-keyword-face)
(,snakemake-builtin-function-re 1 font-lock-builtin-face)
(,snakemake-field-key-indented-re 1 font-lock-type-face)))