aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_cue.lua
diff options
context:
space:
mode:
authorMartino Ferrari <manda.mgf@gmail.com>2023-10-23 17:21:59 +0200
committerGitHub <noreply@github.com>2023-10-23 17:21:59 +0200
commitc7c43e0afddf2af1bc40c3abbf8551da73136d2d (patch)
tree38514029d0a569de2c1372488dae5114333781e6 /plugins/language_cue.lua
parente0f0abb5d24af77f0afe057cd8e17fb120ca971c (diff)
downloadlite-xl-plugins-c7c43e0afddf2af1bc40c3abbf8551da73136d2d.tar.gz
lite-xl-plugins-c7c43e0afddf2af1bc40c3abbf8551da73136d2d.zip
Added syntax for FreeFEM++, MARTe2 framework and CUE (#322)
* added support to FreeFEM++ syntax * added support to MARTe2 Configuration language * updated with new language support * Update language_marte.lua * Update plugins/language_marte.lua Co-authored-by: Guldoman <giulio.lettieri@gmail.com> * added languages * fixed whitespace and new line * Added CUE syntax * reformatted * removed tabs * fixed issue with char * formatted and removed duplicated key * fixed lname and added structure identifier * removed lite-xl version * Update plugins/language_cue.lua Co-authored-by: Guldoman <giulio.lettieri@gmail.com> --------- Co-authored-by: Martino Ferrari <martinogiordano.ferrari@iter.org> Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
Diffstat (limited to 'plugins/language_cue.lua')
-rw-r--r--plugins/language_cue.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/language_cue.lua b/plugins/language_cue.lua
new file mode 100644
index 0000000..50f01f3
--- /dev/null
+++ b/plugins/language_cue.lua
@@ -0,0 +1,41 @@
+-- mod-version:3
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "CUE",
+ files = "%.cue$",
+ comment = "//",
+ patterns = {
+ { pattern = "//.*", type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "`", "`", '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "0[oO_][0-7]+i?", type = "number" },
+ { pattern = "-?0x[%x_]+i?", type = "number" },
+ { pattern = "-?%d+_%di?", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*f?i?", type = "number" },
+ { pattern = "-?%.?%d+f?i?", type = "number" },
+ { pattern = "[%a_][%w_]*%.", type = "literal" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = "#[%a][%w_]*", type = "keyword2" },
+ -- operators
+ { pattern = "[%+%-=/%*%^%%<>!~|&%?:%.]", type = "operator" },
+ },
+ symbols = {
+ ["package"] = "keyword",
+ ["import"] = "keyword",
+ ["let"] = "keyword",
+ ["for"] = "keyword",
+ ["true"] = "literal",
+ ["false"] = "literal",
+ ["string"] = "keyword2",
+ ["bool"] = "keyword2",
+ ["number"] = "keyword2",
+ ["uint32"] = "keyword2",
+ ["int32"] = "keyword2",
+ ["uint16"] = "keyword2",
+ ["int16"] = "keyword2",
+ ["uint8"] = "keyword2",
+ ["float"] = "keyword2",
+ }
+}