Skip to content

Commit

Permalink
Add some more syntax hacks
Browse files Browse the repository at this point in the history
These changes:

 1 Add more Nextflow keywords like view, set, branch
 2 Add highlighting for Nextflow operators and method chains
 3 Add highlighting for string interpolation with ${...}
 4 Change directives to use font-lock-preprocessor-face for better
   visibility
  • Loading branch information
edmundmiller committed Dec 27, 2024
1 parent 662255f commit f78a679
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions nextflow-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,17 @@
"as"
"in"
"instanceof"
"new"))
"new"
"view"
"set"
"branch"))
symbol-end))
(nf-operator . ,(rx (group (or "=~" "==~" "!~"

Check warning on line 113 in nextflow-mode.el

View workflow job for this annotation

GitHub Actions / check (snapshot, false)

White space found at end of line
"|" "||"
".&" ".flatten" ".collect"
".mix" ".dump" ".view"
".set" ".into" ".map" ".filter"))))
(nf-interpolation . ,(rx (group "${" (one-or-more (not "}")) "}")))
(nf-directive . ,(rx (group symbol-start
(or "accelerator"
"afterScript"
Expand Down Expand Up @@ -226,11 +235,15 @@ Returns an alist of name and position pairs for imenu navigation."
(zero-or-more space) ":")
1 font-lock-keyword-face)
(,(nextflow-rx line-start (one-or-more space) nf-directive)
1 font-lock-builtin-face)
1 font-lock-preprocessor-face)
(,(nextflow-rx nf-special)
1 font-lock-builtin-face)
(,(nextflow-rx nf-keyword)
1 font-lock-keyword-face)))
1 font-lock-keyword-face)
(,(nextflow-rx nf-operator)
1 font-lock-builtin-face)
(,(nextflow-rx nf-interpolation)
1 font-lock-variable-name-face)))

(if (bound-and-true-p groovy-font-lock-keywords-level-1)
(with-no-warnings
Expand Down

0 comments on commit f78a679

Please sign in to comment.