Update C Language file (#182)

retype struct symbol, add some preprocessor keywords
This commit is contained in:
Jan 2021-05-14 19:05:58 +02:00 committed by GitHub
parent ea3a7e81be
commit 7d29052367
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -7,7 +7,6 @@ syntax.add {
patterns = { patterns = {
{ pattern = "//.-\n", type = "comment" }, { pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { "/%*", "%*/" }, type = "comment" },
{ pattern = { "#", "[^\\]\n" }, type = "comment" },
{ pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" }, { pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = "-?0x%x+", type = "number" }, { pattern = "-?0x%x+", type = "number" },
@ -15,7 +14,7 @@ syntax.add {
{ pattern = "-?%.?%d+f?", type = "number" }, { pattern = "-?%.?%d+f?", type = "number" },
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
{ pattern = "[%a_][%w_]*%f[(]", type = "function" }, { pattern = "[%a_][%w_]*%f[(]", type = "function" },
{ pattern = "[%a_][%w_]*", type = "symbol" }, { pattern = "#?[%a_][%w_]*", type = "symbol" },
}, },
symbols = { symbols = {
["if"] = "keyword", ["if"] = "keyword",
@ -29,7 +28,7 @@ syntax.add {
["continue"] = "keyword", ["continue"] = "keyword",
["return"] = "keyword", ["return"] = "keyword",
["goto"] = "keyword", ["goto"] = "keyword",
["struct"] = "keyword", ["struct"] = "keyword2",
["union"] = "keyword", ["union"] = "keyword",
["typedef"] = "keyword", ["typedef"] = "keyword",
["enum"] = "keyword", ["enum"] = "keyword",
@ -55,6 +54,17 @@ syntax.add {
["true"] = "literal", ["true"] = "literal",
["false"] = "literal", ["false"] = "literal",
["NULL"] = "literal", ["NULL"] = "literal",
["#include"] = "keyword",
["#if"] = "keyword",
["#ifdef"] = "keyword",
["#ifndef"] = "keyword",
["#else"] = "keyword",
["#elseif"] = "keyword",
["#endif"] = "keyword",
["#define"] = "keyword",
["#warning"] = "keyword",
["#error"] = "keyword",
["#pragma"] = "keyword",
}, },
} }