Files
ccat/config/c.conf
Aadhavan Srinivasan a1309af696 Updated some regexes
One of the expressions used .* to mean 'any character except newline', but since I've
enabled 'RE_SINGLE_LINE' mode, a dot matches a newline as well.
2025-04-23 16:25:48 -04:00

27 lines
882 B
Plaintext

# Priority decreases going downward ie. If two regexes match the same piece of
# text, the one defined earlier will take precedence over the one defined later.
# Comments
'//.*': GRAY
'/\*[^*]*\*+(?:[^/*][^*]*\*+)*/': GRAY
# Constants
'\b[A-Z0-9_]*\b': MAGENTA
# Numbers
'\b\-?[0-9]*\b': MAGENTA
# Strings in double quotes and single quotes
'"(.*?)"': BLUE
"'(.)'": BLUE
# Text inside angle-brackets (used in 'include' statements)
'\<(.*?)\>': BLUE
# Assignments and comparisons
# TODO: Add less than, greater than, not equal to, and struct pointer member access
'(?:\s|\b)(=|==|!=|\<=|\>=|\->)(\s|\b)' : CYAN
# Built-in boolean values, modifiers
'\b(static|const|true|false)\b': DARKBLUE
# Keywords
'\b(if|else|while|do|for|return)\b': CYAN
'(\n|^)(#ifdef|#ifndef|#define|#include)\b': CYAN
# Data Types
'\b(int|char|float|double|void|long|short|unsigned|signed|bool)\b': YELLOW