     ("(name +\\(runtest\\))" 1 font-lock-builtin-face)
     (,(eval-when-compile
         (concat "(" (regexp-opt '("fallback") t)))
-     1 dune-error-face)
-    (,(concat "%{" dune-var-regex "}")
-     (1 dune-error-face)
-     (2 font-lock-builtin-face)
-     (4 font-lock-variable-name-face)
-     (5 font-lock-variable-name-face))))
+     1 dune-error-face)))
 
 (defvar dune-mode-syntax-table
   (let ((table (make-syntax-table)))


(defvar dune-error-face 'dune-error-face
  "Face for errors (e.g. obsolete constructs).")

(defconst dune-stanzas-regex
  (eval-when-compile

(defvar dune-var-kind-regex
  (eval-when-compile
    (regexp-opt
     '("ocaml-config"
       "dep" "exe" "bin" "lib" "libexec" "lib-available"
       "version" "read" "read-lines" "read-strings")
     'words))
  "Optional prefix to variable names.")

(defmacro dune--field-vals (field &rest vals)
  `(list (concat "(" ,field "[[:space:]]+" ,(regexp-opt vals t))
         1 font-lock-constant-face))

(defvar dune-font-lock-keywords
  `((,(concat "(\\(" dune-stanzas-regex "\\)") 1 font-lock-keyword-face)
    ("([^ ]+ +\\(as\\) +[^ ]+)" 1 font-lock-keyword-face)
    (,(concat "(" dune-fields-regex) 1 font-lock-function-name-face)
    (,(concat "%{" dune-var-kind-regex " *\\(\\:\\)[^{}:]*\\(\\(?::\\)?\\)")
     (1 font-lock-builtin-face)
     (2 dune-separator-face)
     (3 dune-separator-face))
    ("%{\\([^{}]*\\)}" 1 font-lock-variable-name-face keep)
    ("\\(:[a-zA-Z]+\\)\\b" 1 font-lock-builtin-face)
    ("\\(true\\|false\\)" 1 font-lock-constant-face)
    ("(\\(select\\)[[:space:]]+[^[:space:]]+[[:space:]]+\\(from\\)\\>"
     (1 font-lock-constant-face)
