Merge pull request #772 from drbo/syntax_bugfix
authorEvan Martin <martine@danga.com>
Sun, 23 Nov 2014 20:14:02 +0000 (12:14 -0800)
committerEvan Martin <martine@danga.com>
Sun, 23 Nov 2014 20:14:02 +0000 (12:14 -0800)
Added highlighting in Emacs for ${...} variables

1  2 
misc/ninja-mode.el

         '("\\([[:alnum:]_]+\\) =" . (1 font-lock-variable-name-face))
         ;; Variable expansion.
         '("\\($[[:alnum:]_]+\\)" . (1 font-lock-variable-name-face))
+        '("\\(${[[:alnum:]._]+}\\)" . (1 font-lock-variable-name-face))
         ;; Rule names
 -       '("rule \\([[:alnum:]_]+\\)" . (1 font-lock-function-name-face))
 +       '("rule +\\([[:alnum:]_.-]+\\)" . (1 font-lock-function-name-face))
 +       ;; Build Statement - highlight the rule used,
 +       ;; allow for escaped $,: in outputs.
 +       '("build +\\(?:[^:$\n]\\|$[:$]\\)+ *: *\\([[:alnum:]_.-]+\\)" .
 +         (1 font-lock-function-name-face))
         ))
  
 -;;;###autoload       
 -(define-derived-mode ninja-mode fundamental-mode "ninja"
 +;;;###autoload
 +(define-derived-mode ninja-mode prog-mode "ninja"
    (setq comment-start "#")
    ; Pass extra "t" to turn off syntax-based fontification -- we don't want
    ; quoted strings highlighted.