From 29e90f290416e85765d0abda6daead452e853ae1 Mon Sep 17 00:00:00 2001 From: Nightwing Date: Wed, 1 Dec 2021 00:18:43 +0900 Subject: Added support for raw string --- plugins/language_rust.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index a8dc017..40aeb5f 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -8,6 +8,7 @@ syntax.add { patterns = { { pattern = "//.-\n", type = "comment" }, { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "`", "`", '\\' }, type = "string" }, { pattern = "0[oO_][0-7]+", type = "number" }, -- cgit v1.2.3 From e5f8317541b8b986c45b234f58192c90434a1365 Mon Sep 17 00:00:00 2001 From: Nightwing Date: Thu, 2 Dec 2021 14:40:07 +0900 Subject: Support for lifetime annotations --- plugins/language_rust.lua | 96 ++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 40aeb5f..eefc33a 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -11,6 +11,8 @@ syntax.add { { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "`", "`", '\\' }, type = "string" }, + { pattern = "%'[%a]*[>%s:]", type = "keyword2"}, + { pattern = { "'", "'", '\\' }, type = "string" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, { pattern = "-?%d+_%d", type = "number" }, @@ -28,59 +30,59 @@ syntax.add { ["break"] = "keyword", ["const"] = "keyword", ["continue"] = "keyword", - ["crate"] = "keyword", - ["dyn"] = "keyword", - ["else"] = "keyword", - ["enum"] = "keyword", - ["extern"] = "keyword", - ["false"] = "keyword", - ["fn"] = "keyword", - ["for"] = "keyword", - ["if"] = "keyword", - ["impl"] = "keyword", - ["in"] = "keyword", - ["let"] = "keyword", - ["loop"] = "keyword", - ["match"] = "keyword", - ["mod"] = "keyword", - ["move"] = "keyword", - ["mut"] = "keyword", - ["pub"] = "keyword", - ["ref"] = "keyword", + ["crate"] = "keyword", + ["dyn"] = "keyword", + ["else"] = "keyword", + ["enum"] = "keyword", + ["extern"] = "keyword", + ["false"] = "keyword", + ["fn"] = "keyword", + ["for"] = "keyword", + ["if"] = "keyword", + ["impl"] = "keyword", + ["in"] = "keyword", + ["let"] = "keyword", + ["loop"] = "keyword", + ["match"] = "keyword", + ["mod"] = "keyword", + ["move"] = "keyword", + ["mut"] = "keyword", + ["pub"] = "keyword", + ["ref"] = "keyword", ["return"] = "keyword", - ["Self"] = "keyword", - ["self"] = "keyword", + ["Self"] = "keyword", + ["self"] = "keyword", ["static"] = "keyword", ["struct"] = "keyword", - ["super"] = "keyword", - ["trait"] = "keyword", - ["true"] = "keyword", - ["type"] = "keyword", + ["super"] = "keyword", + ["trait"] = "keyword", + ["true"] = "keyword", + ["type"] = "keyword", ["unsafe"] = "keyword", - ["use"] = "keyword", + ["use"] = "keyword", ["where"] = "keyword", ["while"] = "keyword", - ["i32"] = "keyword2", - ["i64"] = "keyword2", - ["i128"] = "keyword2", - ["i16"] = "keyword2", - ["i8"] = "keyword2", - ["u8"] = "keyword2", - ["u16"] = "keyword2", - ["u32"] = "keyword2", - ["u64"] = "keyword2", - ["usize"] = "keyword2", - ["isize"] = "keyword2", - ["f32"] = "keyword2", - ["f64"] = "keyword2", - ["f128"] = "keyword2", - ["String"] = "keyword2", - ["char"] = "keyword2", - ["&str"] = "keyword2", - ["bool"] = "keyword2", - ["true"] = "literal", - ["false"] = "literal", - ["None"] = "literal", + ["i32"] = "keyword2", + ["i64"] = "keyword2", + ["i128"] = "keyword2", + ["i16"] = "keyword2", + ["i8"] = "keyword2", + ["u8"] = "keyword2", + ["u16"] = "keyword2", + ["u32"] = "keyword2", + ["u64"] = "keyword2", + ["usize"] = "keyword2", + ["isize"] = "keyword2", + ["f32"] = "keyword2", + ["f64"] = "keyword2", + ["f128"] = "keyword2", + ["String"] = "keyword2", + ["char"] = "keyword2", + ["&str"] = "keyword2", + ["bool"] = "keyword2", + ["true"] = "literal", + ["false"] = "literal", + ["None"] = "literal", ["Some"] = "literal", ["Option"] = "literal", ["Result"] = "literal", -- cgit v1.2.3 From f54baa037ed026922302c17cac2748f0e0c58ef6 Mon Sep 17 00:00:00 2001 From: Nightwing Date: Fri, 3 Dec 2021 20:59:48 +0900 Subject: Bug fixes --- plugins/language_rust.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index eefc33a..3a0d6b8 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -11,8 +11,8 @@ syntax.add { { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "`", "`", '\\' }, type = "string" }, - { pattern = "%'[%a]*[>%s:]", type = "keyword2"}, - { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "'%a*[>%s:]", type = "keyword2"}, + { pattern = "'*'", type = "string" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, { pattern = "-?%d+_%d", type = "number" }, @@ -78,7 +78,7 @@ syntax.add { ["f128"] = "keyword2", ["String"] = "keyword2", ["char"] = "keyword2", - ["&str"] = "keyword2", + ["str"] = "keyword2", ["bool"] = "keyword2", ["true"] = "literal", ["false"] = "literal", -- cgit v1.2.3 From 2fa38447cfe056be3c36a0c51800e788890edb08 Mon Sep 17 00:00:00 2001 From: Nightwing Date: Fri, 3 Dec 2021 21:03:50 +0900 Subject: OOps my bad --- plugins/language_rust.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 3a0d6b8..3732fef 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -10,9 +10,8 @@ syntax.add { { pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "`", "`", '\\' }, type = "string" }, - { pattern = "'%a*[>%s:]", type = "keyword2"}, - { 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" }, -- cgit v1.2.3 From 8abe633e3923335e99cc49e0d7890263da141b98 Mon Sep 17 00:00:00 2001 From: Nightwing <94565465+Nightwing13@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:34:25 +0900 Subject: Fix spacing --- plugins/language_rust.lua | 70 +++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 3732fef..42b167f 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -10,8 +10,8 @@ syntax.add { { pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = "'.'", type = "string" }, - { pattern = "'%a", type = "keyword2" }, + { pattern = "'.'", type = "string" }, + { pattern = "'%a", type = "keyword2" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, { pattern = "-?%d+_%d", type = "number" }, @@ -23,11 +23,11 @@ syntax.add { { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { - ["as"] = "keyword", - ["async"] = "keyword", - ["await"] = "keyword", - ["break"] = "keyword", - ["const"] = "keyword", + ["as"] = "keyword", + ["async"] = "keyword", + ["await"] = "keyword", + ["break"] = "keyword", + ["const"] = "keyword", ["continue"] = "keyword", ["crate"] = "keyword", ["dyn"] = "keyword", @@ -48,33 +48,33 @@ syntax.add { ["mut"] = "keyword", ["pub"] = "keyword", ["ref"] = "keyword", - ["return"] = "keyword", - ["Self"] = "keyword", - ["self"] = "keyword", - ["static"] = "keyword", - ["struct"] = "keyword", - ["super"] = "keyword", - ["trait"] = "keyword", - ["true"] = "keyword", - ["type"] = "keyword", - ["unsafe"] = "keyword", - ["use"] = "keyword", - ["where"] = "keyword", - ["while"] = "keyword", - ["i32"] = "keyword2", - ["i64"] = "keyword2", - ["i128"] = "keyword2", - ["i16"] = "keyword2", - ["i8"] = "keyword2", - ["u8"] = "keyword2", - ["u16"] = "keyword2", - ["u32"] = "keyword2", - ["u64"] = "keyword2", - ["usize"] = "keyword2", - ["isize"] = "keyword2", - ["f32"] = "keyword2", - ["f64"] = "keyword2", - ["f128"] = "keyword2", + ["return"] = "keyword", + ["Self"] = "keyword", + ["self"] = "keyword", + ["static"] = "keyword", + ["struct"] = "keyword", + ["super"] = "keyword", + ["trait"] = "keyword", + ["true"] = "keyword", + ["type"] = "keyword", + ["unsafe"] = "keyword", + ["use"] = "keyword", + ["where"] = "keyword", + ["while"] = "keyword", + ["i32"] = "keyword2", + ["i64"] = "keyword2", + ["i128"] = "keyword2", + ["i16"] = "keyword2", + ["i8"] = "keyword2", + ["u8"] = "keyword2", + ["u16"] = "keyword2", + ["u32"] = "keyword2", + ["u64"] = "keyword2", + ["usize"] = "keyword2", + ["isize"] = "keyword2", + ["f32"] = "keyword2", + ["f64"] = "keyword2", + ["f128"] = "keyword2", ["String"] = "keyword2", ["char"] = "keyword2", ["str"] = "keyword2", @@ -84,7 +84,7 @@ syntax.add { ["None"] = "literal", ["Some"] = "literal", ["Option"] = "literal", - ["Result"] = "literal", + ["Result"] = "literal", }, } -- cgit v1.2.3 From 3627588317a953e1d4170507b1fd73dbcf68d64f Mon Sep 17 00:00:00 2001 From: Nightwing <94565465+Nightwing13@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:37:02 +0900 Subject: Fix spacing 2 --- plugins/language_rust.lua | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 42b167f..f20d35e 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -10,7 +10,7 @@ syntax.add { { pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { 'r#"', '"#', '\\' }, type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = "'.'", type = "string" }, + { pattern = "'.'", type = "string" }, { pattern = "'%a", type = "keyword2" }, { pattern = "0[oO_][0-7]+", type = "number" }, { pattern = "-?0x[%x_]+", type = "number" }, @@ -61,30 +61,30 @@ syntax.add { ["use"] = "keyword", ["where"] = "keyword", ["while"] = "keyword", - ["i32"] = "keyword2", - ["i64"] = "keyword2", - ["i128"] = "keyword2", - ["i16"] = "keyword2", - ["i8"] = "keyword2", - ["u8"] = "keyword2", - ["u16"] = "keyword2", - ["u32"] = "keyword2", - ["u64"] = "keyword2", - ["usize"] = "keyword2", - ["isize"] = "keyword2", - ["f32"] = "keyword2", - ["f64"] = "keyword2", - ["f128"] = "keyword2", - ["String"] = "keyword2", - ["char"] = "keyword2", - ["str"] = "keyword2", - ["bool"] = "keyword2", - ["true"] = "literal", - ["false"] = "literal", - ["None"] = "literal", - ["Some"] = "literal", - ["Option"] = "literal", - ["Result"] = "literal", + ["i32"] = "keyword2", + ["i64"] = "keyword2", + ["i128"] = "keyword2", + ["i16"] = "keyword2", + ["i8"] = "keyword2", + ["u8"] = "keyword2", + ["u16"] = "keyword2", + ["u32"] = "keyword2", + ["u64"] = "keyword2", + ["usize"] = "keyword2", + ["isize"] = "keyword2", + ["f32"] = "keyword2", + ["f64"] = "keyword2", + ["f128"] = "keyword2", + ["String"] = "keyword2", + ["char"] = "keyword2", + ["str"] = "keyword2", + ["bool"] = "keyword2", + ["true"] = "literal", + ["false"] = "literal", + ["None"] = "literal", + ["Some"] = "literal", + ["Option"] = "literal", + ["Result"] = "literal", }, } -- cgit v1.2.3