diff options
author | Ben <89769190+0x42656E@users.noreply.github.com> | 2022-11-15 16:50:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 11:50:39 -0400 |
commit | f4af0d9edf7549762110c84e96d66d139c39feb2 (patch) | |
tree | e6d95bb99040637adadbcd65b187f58aeda3af1e /plugins/language_rust.lua | |
parent | c143aa853160f85bf2c843ff1a76e233e46498d6 (diff) | |
download | lite-xl-plugins-f4af0d9edf7549762110c84e96d66d139c39feb2.tar.gz lite-xl-plugins-f4af0d9edf7549762110c84e96d66d139c39feb2.zip |
language_rust: better lifetime syntax support (#152)
Diffstat (limited to 'plugins/language_rust.lua')
-rw-r--r-- | plugins/language_rust.lua | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 848e8b1..fa5479d 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -6,21 +6,22 @@ syntax.add { files = { "%.rs$" }, comment = "//", patterns = { - { pattern = "//.-\n", type = "comment" }, - { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { 'r#"', '"#', '\\' }, type = "string" }, - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = "'.'", type = "string" }, - { pattern = "'%a", type = "keyword2" }, - { pattern = "0[oO_][0-7]+", type = "number" }, - { pattern = "-?0x[%x_]+", type = "number" }, - { pattern = "-?%d+_%d", 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_]*%f[(]", type = "function" }, - { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "//.-\n", type = "comment" }, + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { 'r#"', '"#', '\\' }, type = "string" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = "'.'", type = "string" }, + { pattern = "'%a", type = "keyword2" }, + { pattern = "0[oO_][0-7]+", type = "number" }, + { pattern = "-?0x[%x_]+", type = "number" }, + { pattern = "-?%d+_%d", type = "number" }, + { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, + { pattern = "-?%.?%d+f?", type = "number" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { regex = "[[:alpha:]_][\\w]*(?=\\s*<[\\w\\s,']+>\\s*\\()", type = "function" }, + { pattern = "[%a_][%w_]*!%f[%[(]", type = "function" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { ["as"] = "keyword", @@ -85,5 +86,3 @@ syntax.add { ["Result"] = "literal", }, } - - |