diff options
Diffstat (limited to 'plugins/language_cpp.lua')
-rw-r--r-- | plugins/language_cpp.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/language_cpp.lua b/plugins/language_cpp.lua index 4a734e0..d1656b4 100644 --- a/plugins/language_cpp.lua +++ b/plugins/language_cpp.lua @@ -12,7 +12,6 @@ syntax.add { patterns = { { pattern = "//.-\n", type = "comment" }, { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { "#", "[^\\]\n" }, type = "comment" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "'", "'", '\\' }, type = "string" }, { pattern = "-?0x%x+", type = "number" }, @@ -20,7 +19,7 @@ syntax.add { { pattern = "-?%.?%d+f?", type = "number" }, { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "#[%a_][%w_]*", type = "symbol" }, }, symbols = { ["alignof"] = "keyword", @@ -88,7 +87,7 @@ syntax.add { ["continue"] = "keyword", ["return"] = "keyword", ["goto"] = "keyword", - ["struct"] = "keyword", + ["struct"] = "keyword2", ["union"] = "keyword", ["typedef"] = "keyword", ["enum"] = "keyword", @@ -118,5 +117,16 @@ syntax.add { ["char16_t"] = "keyword2", ["char32_t"] = "keyword2", ["NULL"] = "literal", + ["#include"] = "keyword", + ["#if"] = "keyword", + ["#ifdef"] = "keyword", + ["#ifndef"] = "keyword", + ["#else"] = "keyword", + ["#elseif"] = "keyword", + ["#endif"] = "keyword", + ["#define"] = "keyword", + ["#warning"] = "keyword", + ["#error"] = "keyword", + ["#pragma"] = "keyword", }, } |