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>
master
Benno Schulenberg 2021-03-14 17:18:55 +01:00
parent ede64d7ea0
commit 3d9e803aed
1 changed files with 2 additions and 1 deletions

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)\>"