diff options
author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-01-09 19:25:19 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-01-09 19:25:19 +0100 |
commit | 5bc20211efd20f6a531990f8c99158b408a97b9f (patch) | |
tree | 64ae591ce29d2e5c9e66d22d91429f5fd9cc79c4 /plugins/language_objc.lua | |
parent | 1446cd2357239caa4f9157d5c8404a2384626caa (diff) | |
download | lite-xl-plugins-5bc20211efd20f6a531990f8c99158b408a97b9f.tar.gz lite-xl-plugins-5bc20211efd20f6a531990f8c99158b408a97b9f.zip |
Add plugin for Objective C language
Diffstat (limited to 'plugins/language_objc.lua')
-rw-r--r-- | plugins/language_objc.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/language_objc.lua b/plugins/language_objc.lua new file mode 100644 index 0000000..221e5c3 --- /dev/null +++ b/plugins/language_objc.lua @@ -0,0 +1,61 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.m$" }, + comment = "//", + patterns = { + { pattern = "//.-\n", type = "comment" }, + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { "#", "[^\\]\n" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "-?0x%x+", type = "number" }, + { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, + { pattern = "-?%.?%d+f?", type = "number" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "@[%a_][%w_]*", type = "keyword2" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + }, + symbols = { + ["if"] = "keyword", + ["then"] = "keyword", + ["else"] = "keyword", + ["elseif"] = "keyword", + ["do"] = "keyword", + ["while"] = "keyword", + ["for"] = "keyword", + ["break"] = "keyword", + ["continue"] = "keyword", + ["return"] = "keyword", + ["goto"] = "keyword", + ["struct"] = "keyword", + ["union"] = "keyword", + ["typedef"] = "keyword", + ["enum"] = "keyword", + ["extern"] = "keyword", + ["static"] = "keyword", + ["volatile"] = "keyword", + ["const"] = "keyword", + ["inline"] = "keyword", + ["switch"] = "keyword", + ["case"] = "keyword", + ["default"] = "keyword", + ["auto"] = "keyword", + ["const"] = "keyword", + ["void"] = "keyword", + ["int"] = "keyword2", + ["short"] = "keyword2", + ["long"] = "keyword2", + ["float"] = "keyword2", + ["double"] = "keyword2", + ["char"] = "keyword2", + ["unsigned"] = "keyword2", + ["bool"] = "keyword2", + ["true"] = "literal", + ["false"] = "literal", + ["NULL"] = "literal", + ["nil"] = "literal", + }, +} + |