From c7f35e018278309257ed303a1090eb915f9e718a Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 14 May 2021 19:45:13 +0200 Subject: Update C++ Language file See https://github.com/franko/lite-xl/pull/182#issuecomment-841378446 --- plugins/language_cpp.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'plugins/language_cpp.lua') 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", }, } -- cgit v1.2.3