aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_carbon.lua
diff options
context:
space:
mode:
authorRohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com>2024-04-08 15:00:49 +0530
committerGitHub <noreply@github.com>2024-04-08 11:30:49 +0200
commit7bbb5368e1778e4ea58b64d238b8d8fbb93a0cbc (patch)
tree2c169abecc489044c720a3f8629da74aed307aea /plugins/language_carbon.lua
parent5452497648776335ffc20e6081996ec1e63b9557 (diff)
downloadlite-xl-plugins-7bbb5368e1778e4ea58b64d238b8d8fbb93a0cbc.tar.gz
lite-xl-plugins-7bbb5368e1778e4ea58b64d238b8d8fbb93a0cbc.zip
Integrate `language_{buzz,carbon,fortran,swift}` remote plugins (#417)
* Update manifest.json * Create language_carbon.lua * Update language_carbon.lua * Create language_fortran.lua * Update language_carbon.lua * Create language_swift.lua * Create language_buzz.lua * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
Diffstat (limited to 'plugins/language_carbon.lua')
-rw-r--r--plugins/language_carbon.lua83
1 files changed, 83 insertions, 0 deletions
diff --git a/plugins/language_carbon.lua b/plugins/language_carbon.lua
new file mode 100644
index 0000000..ea8c621
--- /dev/null
+++ b/plugins/language_carbon.lua
@@ -0,0 +1,83 @@
+-- Author: Rohan Vashisht: https://github.com/rohanvashisht1234/
+
+-- mod-version:3
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "Carbon", -- tested ok
+ files = {
+ "%.carbon$" -- tested ok
+ },
+ comment = "//", -- tested ok
+ patterns = {
+ { pattern = { '"', '"', '\\' }, type = "string" }, -- tested ok
+ { pattern = { '"""', '"""', '\\' }, type = "string" }, -- tested ok
+ { pattern = { "'''", "'''", '\\' }, type = "string" }, -- tested ok
+ { pattern = "//.*", type = "comment" }, -- tested ok
+ { pattern = "[!%-/*?:=><+]", type = "operator" }, -- tested ok
+ { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- tested ok
+ { pattern = "packages()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "let()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "import()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "impl()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "class()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "var()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "package()%s+()[%a_][%w_]*", type = { "keyword", "normal", "literal" } }, -- tested ok
+ { pattern = "-?%d+[%d%.eE_]*", type = "number" }, -- tested ok
+ { pattern = "-?%.?%d+", type = "number" }, -- tested ok
+ { pattern = "[%a_][%w_]*", type = "normal" }, -- tested ok
+ },
+ symbols = {
+ ["package"] = "keyword", -- tested ok
+ ["import"] = "keyword", -- tested ok
+ ["fn"] = "keyword", -- tested ok
+ ["var"] = "keyword", -- tested ok
+ ["for"] = "keyword", -- tested ok
+ ["return"] = "keyword", -- tested ok
+ ["class"] = "keyword", -- tested ok
+ ["api"] = "keyword", -- tested ok
+ ["i8"] = "keyword", -- tested ok
+ ["i16"] = "keyword", -- tested ok
+ ["i32"] = "keyword", -- tested ok
+ ["i64"] = "keyword", -- tested ok
+ ["i128"] = "keyword", -- tested ok
+ ["i256"] = "keyword", -- tested ok
+ ["u8"] = "keyword", -- tested ok
+ ["u16"] = "keyword", -- tested ok
+ ["u32"] = "keyword", -- tested ok
+ ["u64"] = "keyword", -- tested ok
+ ["u128"] = "keyword", -- tested ok
+ ["u256"] = "keyword", -- tested ok
+ ["f8"] = "keyword", -- tested ok
+ ["f16"] = "keyword", -- tested ok
+ ["f32"] = "keyword", -- tested ok
+ ["f64"] = "keyword", -- tested ok
+ ["f128"] = "keyword", -- tested ok
+ ["if"] = "keyword", -- tested ok
+ ["else"] = "keyword", -- tested ok
+ ["auto"] = "keyword", -- tested ok
+ ["let"] = "keyword", -- tested ok
+ ["File"] = "keyword", -- tested ok
+ ["while"] = "keyword", -- tested ok
+ ["match"] = "keyword", -- tested ok
+ ["case"] = "keyword", -- tested ok
+ ["default"] = "keyword", -- tested ok
+ ["returned"] = "keyword", -- tested ok
+ ["base"] = "keyword", -- tested ok
+ ["bool"] = "keyword", -- tested ok
+ ["virtual"] = "keyword", -- tested ok
+ ["abstract"] = "keyword", -- tested ok
+ ["String"] = "keyword", -- tested ok
+
+ ["impl"] = "keyword2", -- tested ok
+ ["extend"] = "keyword", -- tested ok
+ ["partial"] = "keyword2", -- tested ok
+ ["Self"] = "keyword", -- tested ok
+ ["Int"] = "keyword", -- tested ok
+ ["UInt"] = "keyword", -- tested ok
+ ["Base"] = "keyword", -- tested ok
+ ["template"] = "keyword2", -- tested ok
+ ["true"] = "keyword2", -- tested ok
+ ["false"] = "keyword2", -- tested ok
+ }
+}