Fix an issue where the pattern doesn't advance,
[quincer.git] / syntax / quincer.el
blobd72c27f32206c0b8f9dbabbddd38739f0c9c6950
1 ;; https://www.emacswiki.org/emacs/GenericMode
2 (require 'generic-x)
3 (define-generic-mode
4 'quincer-mode ;; name of the mode to create
5 nil
6 '("run" "once" "loop"
7 "voice"
8 "pattern"
9 "cc" "pc" "note"
10 "include"
11 "clock") ;; some keywords
13 ;; comments. Require # preceded by space or at line-start
14 ;; otherwise the note 'f#' looks like a comment start
15 ("\\(\\(^\\)\\|\\( \\)\\)\\(#.*\\)$" (4 'font-lock-comment-face))
17 ;; highlight output name in clock declaration
18 ("^clock[ ]*\\(\\sw*\\)[ ]*.*" (1 'font-lock-string-face))
20 ;; highlignt output and voice names in voice declaration
21 ("^voice[ ]*\\(\\sw*\\)[ ]*\\(\\sw*\\)[ ]*.*"
22 (1 'font-lock-variable-name-face) (2 'font-lock-string-face))
24 ;; highlight event definition line
25 ("^\\(.\\) [^|\n]*$" (1 'font-lock-regexp-grouping-construct))
27 ;; highlight tick line
28 ("^[0.'S|]\\{4,\\}$" . 'font-lock-function-name-face)
30 ;; highlight notes, pipe and voice name in pattern line
31 ("^\\([^|]*\\)\\(|\\)[ ]*\\(\\sw*\\)$" (1 'font-lock-regexp-grouping-construct)
32 (2 'font-lock-function-name-face) (3 'font-lock-variable-name-face))
34 '("\\.qn$") ;; files for which to activate this mode
35 nil ;; other functions to call
36 "A mode for quincer files" ;; doc string for this mode