In many places a carriage return is not valid whitespace and should
thus not be colored as such. In some of these places a vertical tab
or form feed is maybe valid whitespace, but it would be ugly or even
wrong to color them because they are not part of the subsequent
comment or keyword.
This fixes https://savannah.gnu.org/bugs/?60456.
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>
Labels may contain digits (after the first character).
And the colon after "default" should not be colored.
Inspired-by: Hussam al-Homsi <sawuare@gmail.com>
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>
For extensionless files, recognize C/C++ ones from the mode name
between the -*- marks on the first line.
This addresses https://savannah.gnu.org/patch/?9719.
Inspired-by: Devin Hussey <husseydevin@gmail.com>
This brings color to CakePHP template files, and to CUDA files.
This addresses https://bugs.debian.org/932192.
Requested-by: Jérôme Bardot <bardot.jerome@gmail.com>
Some of these directives are now colored in their entirety, while for
a few others it's still just the keyword itself that is colored.
Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program". Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either. So, they have been adjusted, new ones added, and
old ones deleted.
This fixes https://savannah.gnu.org/bugs/?52445.