diff options
author | StunxFS <56417208+StunxFS@users.noreply.github.com> | 2022-05-20 11:27:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 11:27:59 -0400 |
commit | c11823de7802ac26fef1821c177852d3874735da (patch) | |
tree | 07e510a791fbb12cdd8fe1ae58bdae9e0f9d7c5e /plugins | |
parent | 63c79236aa3605fdad21fde345d2b9def659e777 (diff) | |
download | lite-xl-plugins-c11823de7802ac26fef1821c177852d3874735da.tar.gz lite-xl-plugins-c11823de7802ac26fef1821c177852d3874735da.zip |
Update language_rivet.lua
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_rivet.lua | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/plugins/language_rivet.lua b/plugins/language_rivet.lua index 9aa3462..cf203b1 100644 --- a/plugins/language_rivet.lua +++ b/plugins/language_rivet.lua @@ -13,8 +13,8 @@ syntax.add { patterns = { {pattern = "//.-\n", type = "comment"}, {pattern = {"/%*", "%*/"}, type = "comment"}, - {pattern = {'"', '"', "\\"}, type = "string"}, - {pattern = "'\\?.'", type = "string"}, + {pattern = {'[rb]?"', '"', "\\"}, type = "string"}, + {pattern = {"[b]?'", "'", '\\' }, type = "string"}, {pattern = "0b[01_]+", type = "number"}, {pattern = "0o[0-7_]+", type = "number"}, {pattern = "0x[%x_]+", type = "number"}, @@ -26,11 +26,11 @@ syntax.add { {pattern = "[%a_][%w_]*::", type = "keyword2"}, {pattern = "[A-Z][%w_]*", type = "keyword2"}, -- types and constants {pattern = "[%a_][%w_]*%f[(]", type = "function"}, - {pattern = "[%a_][%w_]*!%f[%[(]", type = "keyword2"}, + {pattern = "[%a_][%w_]*!%f[(]", type = "keyword2"}, {pattern = "[%a_][%w_]*", type = "symbol"}, - {pattern = "%$%s?[%a_][%w_]*", type = "keyword"}, - {pattern = "#%s?include%s()<.->", type = {"keyword", "string"}}, - {pattern = "#%s?[%a_][%w_]*", type = "keyword"} + {pattern = {"#%[", "%]"}, type = "keyword"}, + {pattern = "%$%s?[%a_][%w_]*", type = "keyword2"}, + {pattern = "%@%s?[%a_][%w_]*", type = "keyword2"}, }, symbols = { ["extern"] = "keyword", @@ -42,20 +42,27 @@ syntax.add { ["pkg"] = "keyword", ["mod"] = "keyword", ["const"] = "keyword", + ["static"] = "keyword", ["trait"] = "keyword", ["struct"] = "keyword", ["union"] = "keyword", ["type"] = "keyword", + ["errtype"] = "keyword", ["enum"] = "keyword", ["fn"] = "keyword", ["test"] = "keyword", - ["impl"] = "keyword", + ["extend"] = "keyword", + + -- comptime `if` and `match` expr + ["$if"] = "keyword", + ["$elif"] = "keyword", + ["$else"] = "keyword", + ["$match"] = "keyword", - ["match"] = "keyword", ["if"] = "keyword", ["elif"] = "keyword", ["else"] = "keyword", - ["loop"] = "keyword", + ["match"] = "keyword", ["while"] = "keyword", ["for"] = "keyword", @@ -68,18 +75,17 @@ syntax.add { ["mut"] = "keyword", ["unsafe"] = "keyword", ["goto"] = "keyword", - ["go"] = "keyword", - ["try"] = "keyword", ["orelse"] = "keyword", ["catch"] = "keyword", ["cast"] = "keyword", - ["is"] = "keyword", - ["in"] = "keyword", ["or"] = "keyword", ["and"] = "keyword", + ["is"] = "keyword", + ["in"] = "keyword", -- types - ["ptr"] = "keyword2", + ["c_void"] = "keyword2", + ["void"] = "keyword2", ["bool"] = "keyword2", ["i8"] = "keyword2", ["i16"] = "keyword2", @@ -91,7 +97,7 @@ syntax.add { ["u64"] = "keyword2", ["f32"] = "keyword2", ["f64"] = "keyword2", - ["char"] = "keyword2", + ["rune"] = "keyword2", ["isize"] = "keyword2", ["usize"] = "keyword2", ["str"] = "keyword2", @@ -105,4 +111,3 @@ syntax.add { ["none"] = "literal" } } - |