Highlight preprocessor directives

This commit is contained in:
Timothy Warren 2019-08-21 10:02:09 -04:00
parent 60e4d3ab68
commit 6d798d92d4
1 changed files with 7 additions and 1 deletions

8
kilo.c
View File

@ -108,11 +108,17 @@ struct editorConfig E;
char *C_HL_extensions[] = { ".c", ".h", ".cpp", NULL }; char *C_HL_extensions[] = { ".c", ".h", ".cpp", NULL };
char *C_HL_keywords[] = { char *C_HL_keywords[] = {
// Keywords
"switch", "if", "while", "for", "break", "continue", "return", "else", "switch", "if", "while", "for", "break", "continue", "return", "else",
"struct", "union", "typedef", "static", "enum", "class", "case", "struct", "union", "typedef", "static", "enum", "class", "case",
// Types
"int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|", "int|", "long|", "double|", "float|", "char|", "unsigned|", "signed|",
"void|", NULL "void|",
// Preprocessor Directives
"#define|", "#endif|", "#error|", "#if|", "#ifdef|", "#ifndef|", "#include|",
"#undef|", NULL
}; };
struct editorSyntax HLDB[] = { struct editorSyntax HLDB[] = {