commit 8492de53f791de946e26e82845905de085a30f3a
parent a1dc1376be922efa76e7bca9ee977a1dec70227c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 30 May 2018 11:29:08 +0200
syntax: makefile: color all keywords that GNU make recognizes
Plus one that automake recognizes: if. Color them only at the start
of a line. Also color all possible assignment sequences (surrounded
by spaces to not color the ones in shell fragments), and add some
comments.
Diffstat:
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc
@@ -4,11 +4,21 @@ syntax makefile "(/((GNU)?m|M)akefile[^/]*$|\.(make|mk)$)"
magic "makefile script"
comment "#"
-color red "[:=]"
-color magenta "\<(if|ifeq|else|endif)\>"
+# Assignments.
+color red " (:?:|\+|\?)?= "
+
+# Keywords.
+color magenta "^(if|ifn?def|ifn?eq|else|endif|(-|s)?include)\>"
+color magenta "^((override +)?(un)?define|endef|(un)?export|private|vpath)\>"
+
+# Variable expansions.
color blue "\$+[{(][a-zA-Z0-9_-]+[})]"
+
+# Targets.
color brightblue "^[^ ]+:"
+
+# Comments.
color green "(^|[[:space:]]+)#.*"
-## Trailing whitespace.
+# Trailing whitespace.
color ,green "[[:space:]]+$"