Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 781aa24

Browse files
committed
Add highlighting of rule in build statements
Highlight the rule being used in a build statement. Also add `.` to acceptable characters in a rule name and relax whitespace matching before the name.
1 parent 234e499 commit 781aa24

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

misc/ninja-mode.el

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
;; Variable expansion.
3333
'("\\($[[:alnum:]_]+\\)" . (1 font-lock-variable-name-face))
3434
;; Rule names
35-
'("rule \\([[:alnum:]_-]+\\)" . (1 font-lock-function-name-face))
35+
'("rule +\\([[:alnum:]_.-]+\\)" . (1 font-lock-function-name-face))
36+
;; Build Statement - highlight the rule used, allow for escaped $,: in outputs
37+
'("build +\\(?:[^:$\n]\\|$[:$]\\)+ *: *\\([[:alnum:]_.-]+\\)" .
38+
(1 font-lock-function-name-face))
39+
3640
))
3741

3842
;;;###autoload

0 commit comments

Comments
 (0)