From cab9294f6247fa5812dd0eedd52ee878e9187552 Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi Date: Tue, 1 Sep 2020 03:45:58 -0400 Subject: [PATCH] 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 Signed-off-by: Benno Schulenberg --- syntax/c.nanorc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/c.nanorc b/syntax/c.nanorc index 53ac6efc..cc1588c9 100644 --- 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 "//.*"