From c1a27fa340cc8921a35971e442a0836781b1e923 Mon Sep 17 00:00:00 2001 From: Property404 Date: Sun, 10 Jul 2016 18:37:41 -0400 Subject: Added all C and C++ keywords. --- kilo.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/kilo.c b/kilo.c index 4b1d89b..fbb30f9 100644 --- a/kilo.c +++ b/kilo.c @@ -158,14 +158,25 @@ void editorSetStatusMessage(const char *fmt, ...); * There is no support to highlight patterns currently. */ /* C / C++ */ -char *C_HL_extensions[] = {".c",".cpp",NULL}; +char *C_HL_extensions[] = {".c",".h",".cpp",".hpp",".cc",NULL}; char *C_HL_keywords[] = { - /* A few C / C++ keywords */ - "switch","if","while","for","break","continue","return","else", - "struct","union","typedef","static","enum","class", - /* C types */ + /* C Keywords */ + "auto","break","case","continue","default","do","else","enum", + "extern","for","goto","if","register","return","sizeof","static", + "struct","switch","typedef","union","volatile","while","NULL", + + /* C++ Keywords */ + "alignas","alignof","and","and_eq","asm","bitand","bitor","class", + "compl","constexpr","const_cast","deltype","delete","dynamic_cast", + "explicit","export","false","friend","inline","mutable","namespace", + "new","noexcept","not","not_eq","nullptr","operator","or","or_eq", + "private","protected","public","reinterpret_cast","static_assert", + "static_cast","template","this","thread_local","throw","true","try", + "typeid","typename","virtual","xor","xor_eq", + + /* C types */ "int|","long|","double|","float|","char|","unsigned|","signed|", - "void|",NULL + "void|","short|","auto|","const|","bool|",NULL }; /* Here we define an array of syntax highlights by extensions, keywords, -- cgit v1.2.3