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>
This commit is contained in:
Hussam al-Homsi 2021-04-25 16:08:48 -04:00 committed by Benno Schulenberg
parent 6b7c661fb7
commit 96ebaf8ab4

View File

@ -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="(\`|[^\\])$"