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 = {
{ pattern = "//.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
{ pattern = { "#", "[^\\]\n" }, type = "comment" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = "-?0x%x+", type = "number" },
@ -15,7 +14,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 = {
["if"] = "keyword",
@ -29,7 +28,7 @@ syntax.add {
["continue"] = "keyword",
["return"] = "keyword",
["goto"] = "keyword",
["struct"] = "keyword",
["struct"] = "keyword2",
["union"] = "keyword",
["typedef"] = "keyword",
["enum"] = "keyword",
@ -55,6 +54,17 @@ syntax.add {
["true"] = "literal",
["false"] = "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",
},
}