syntax: c: colorize also labels that contain digits, and uncolorize colon

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>
This commit is contained in:
Benno Schulenberg 2021-03-14 17:18:55 +01:00
parent ede64d7ea0
commit 3d9e803aed

View File

@ -8,7 +8,8 @@ comment "//"
# Constants.
color brightred "\<[A-Z_][0-9A-Z_]*\>"
# Labels.
color brightmagenta "^[[:space:]]*[A-Z_a-z]+:[[:space:]]*$"
color brightmagenta "^\s*[A-Z_a-z][0-9A-Z_a-z]*:\s*$"
color normal ":\s*$"
# Types and related keywords.
color green "\<(auto|bool|char|const|double|enum|extern|float|inline|int|long|restrict|short|signed|sizeof|static|struct|typedef|union|unsigned|void)\>"