nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 96ebaf8ab46d8ca1ea4e360f58314d263b99e9f6
parent 6b7c661fb7385637286b44c37d8c1ae6bf45290f
Author: Hussam al-Homsi <sawuare@gmail.com>
Date:   Sun, 25 Apr 2021 16:08:48 -0400

syntax: c: make the highlighting of '#include <...>' more compliant

Changes:
  1. There may be zero spaces between 'include' and '<...>'.
  2. Blanks and '=' may occur inside '<...>' but '>' may not.
  3. There must be at least one character inside '<...>'.

References:
  Change 1:
    C:   www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf#subsection.6.10.2
    C++: www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf#section.19.2

  Changes 2 and 3:
    C:   www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf#subsection.6.4.7
    C++: www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf#section.5.8

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>

Diffstat:
Msyntax/c.nanorc | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/syntax/c.nanorc b/syntax/c.nanorc @@ -30,7 +30,7 @@ color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidd # Strings. (In general you will want your strings and comments to come last, # because highlighting rules are applied in the order they are read in.) -color brightyellow ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]+<[^[:blank:]=]*>" +color brightyellow ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]*<[^>]+>" # Preprocessor directives. color brightcyan start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$"