commit 3480518a5ce1232e005ff4907599193c1ff8394f
parent b48dfde3b2a3160f56d9db8dfe604c48203a2ff5
Author: Ryan Westlund <rlwestlund@gmail.com>
Date: Sun, 24 May 2020 17:20:38 -0400
syntax: go: highlight the chan keyword, and the special +build comment
This fixes https://savannah.gnu.org/bugs/?58424
Reported-by: Ryan Westlund <rlwestlund@gmail.com>
Signed-off-by: Ryan Westlund <rlwestlund@gmail.com>
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/syntax/go.nanorc b/syntax/go.nanorc
@@ -7,7 +7,8 @@ formatter gofmt -w
# Types.
color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>"
-color green "\<((<-[[:space:]]*)chan|chan[[:space:]]*<-|const|func|interface|map|struct|type|var)\>"
+color green "\<(chan|const|func|interface|map|struct|type|var)\>"
+color green "<-[[:space:]]*chan\>|\<chan[[:space:]]*<-"
# Predefined functions.
color blue "\<(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\>"
@@ -20,7 +21,6 @@ color magenta "\<(break|continue|fallthrough|goto|return)\>"
# Declarations.
color brightcyan "\<(package|import)\>"
-color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
# Literals.
color red "\<([1-9][0-9]*|0[0-7]*|0[xX][0-9A-Fa-f]+)\>"
@@ -39,5 +39,8 @@ color red start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
+# Special comments.
+color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
+
# Trailing whitespace.
color ,green "[[:space:]]+$"