aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_julia.lua
diff options
context:
space:
mode:
authorNightwing <jobinsjjc1492@protonmail.com>2021-12-03 22:42:12 +0900
committerNightwing <jobinsjjc1492@protonmail.com>2021-12-03 22:42:12 +0900
commit6bdc51987ec0d08bb7664a00089dc165ea742e5d (patch)
tree3f9b002a22e7eed0c167f983f720cc0297148e0a /plugins/language_julia.lua
parent15f7af5cfd22b27315e7ed2fc4298c1ee6ab573a (diff)
downloadlite-xl-plugins-6bdc51987ec0d08bb7664a00089dc165ea742e5d.tar.gz
lite-xl-plugins-6bdc51987ec0d08bb7664a00089dc165ea742e5d.zip
Improved Julia syntax
Diffstat (limited to 'plugins/language_julia.lua')
-rw-r--r--plugins/language_julia.lua29
1 files changed, 17 insertions, 12 deletions
diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua
index 6dea1a8..ecdbdc0 100644
--- a/plugins/language_julia.lua
+++ b/plugins/language_julia.lua
@@ -9,22 +9,25 @@ syntax.add {
files = { "%.jl$" },
comment = "#",
patterns = {
- { pattern = { "#=", "=#" }, type = "comment" },
- { pattern = "#.-\n", type = "comment" },
- { pattern = '[%a_][%w_]*"""*[%a_][%w_]*"""', type = "function" },
- { pattern = { '[ruU]?"', '"', '\\' }, type = "string" },
- { pattern = { "[ruU]?'", "'", '\\' }, type = "string" },
+ {pattern = {"#=", "=#"}, type="comment" },
+ {pattern = "#.*$", type="comment" },
+ { pattern = "%d%w*[%.-+*//]", type = "number" },
{ pattern = "0[oO_][0-7]+", type = "number" },
{ pattern = "-?0x[%x_]+", type = "number" },
{ pattern = "-?0b[%x_]+", type = "number" },
{ pattern = "-?%d+_%d", type = "number" },
{ pattern = "-?%d+[%d%.eE]*f?", type = "number" },
{ pattern = "-?%.?%d+f?", type = "number" },
- { pattern = "[%+%-=/%*%^%%<>!~|&%:]", type = "operator" },
+ { pattern = "[^%d%g]%:%a*", type = "function" },
+ { pattern = "[%+%-=/%*%^%%<>!~|&%:]",type = "operator"},
+ { pattern = '""".*"""', type = "string" },
+ { pattern = '".*"', type = "string" },
+ { pattern = '[bv]".*"', type = "string" },
+ { pattern = 'r".*$', type = "string" },
+ { pattern = "'\\.*'", type = "string" },
+ { pattern = "'.'", type = "string" },
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
- { pattern = "@[%a_][%w_]*[%a_][%w_]", type = "function" },
- { pattern = "[%a_][%w_]*%.*!", type = "keyword2" },
- { pattern = "{[%a_][%w_]*}", type = "string" },
+ { pattern = ".*!", type="function"},
{ pattern = "[%a_][%w_]*", type = "symbol" },
},
symbols = {
@@ -53,6 +56,7 @@ syntax.add {
["let"] = "keyword",
["local"] = "keyword",
["macro"] = "keyword",
+ ["type"] = "keyword",
["module"] = "keyword",
["mutable"] = "keyword",
["quote"] = "keyword",
@@ -65,12 +69,13 @@ syntax.add {
-- types
["struct"] = "keyword2",
- ["abstract type"] = "keyword2",
- ["primitive type"] = "keyword2",
- ["mutable struct"] = "keyword2",
+ ["abstract"] = "keyword2",
+ ["primitive"] = "keyword2",
+ ["mutable"] = "keyword2",
["Char"] = "keyword2",
["Bool"] = "keyword2",
["Int"] = "keyword2",
+ ["Integer"] = "keyword2",
["Int8"] = "keyword2",
["UInt8"] = "keyword2",
["Int16"] = "keyword2",