From f4af0d9edf7549762110c84e96d66d139c39feb2 Mon Sep 17 00:00:00 2001 From: Ben <89769190+0x42656E@users.noreply.github.com> Date: Tue, 15 Nov 2022 16:50:39 +0100 Subject: language_rust: better lifetime syntax support (#152) --- plugins/language_rust.lua | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'plugins') 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", }, } - - -- cgit v1.2.3