commit cab9294f6247fa5812dd0eedd52ee878e9187552
parent 98a24fc8f99ae8160bf0e9ce3d2e57e3b231e9a5
Author: Hussam al-Homsi <sawuare@gmail.com>
Date: Tue, 1 Sep 2020 03:45:58 -0400
syntax: c: colorize also one-character constants, and the null directive
Constants that consist of a single character are valid too.
And a lone hash character on a line by itself also.
Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/syntax/c.nanorc b/syntax/c.nanorc
@@ -6,7 +6,7 @@ magic "^(C|C\+\+) (source|program)"
comment "//"
# Constants.
-color brightred "\<[A-Z_][0-9A-Z_]+\>"
+color brightred "\<[A-Z_][0-9A-Z_]*\>"
# Labels.
color brightmagenta "^[[:space:]]*[A-Z_a-z]+:[[:space:]]*$"
@@ -27,7 +27,7 @@ color brightyellow ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]+<[^[:blank:]
# Preprocessor directives.
color brightcyan start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$"
-color brightcyan "^[[:space:]]*#[[:space:]]*(define|else|endif|include(_next)?|undef)\>"
+color brightcyan "^[[:space:]]*#[[:space:]]*((define|else|endif|include(_next)?|undef)\>|$)"
# Comments.
color brightblue "//.*"