From 3c68655f334aa4c4d3f9825e8370d2e86ae6d261 Mon Sep 17 00:00:00 2001 From: edwloef Date: Sat, 1 Mar 2025 13:58:30 +0100 Subject: [PATCH] add syntax highlighting for new rust keywords and types (#3677) --- runtime/syntax/rust.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/rust.yaml b/runtime/syntax/rust.yaml index ba59565b34..a1b4e6cf2c 100644 --- a/runtime/syntax/rust.yaml +++ b/runtime/syntax/rust.yaml @@ -7,7 +7,7 @@ rules: # function definition - identifier: "fn [a-z0-9_]+" # Reserved words - - statement: "\\b(abstract|alignof|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\\b" + - statement: "\\b(abstract|alignof|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|gen|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|try|unsafe|unsized|use|virtual|where|while|yield)\\b" # macros - special: "[a-z_]+!" # Constants @@ -19,7 +19,7 @@ rules: # Traits/Enums/Structs/Types/etc. - type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b" # Builtin types that start with lowercase. - - type: "\\b(bool|str|isize|usize|((i|u)(8|16|32|64))|f32|f64)\\b" + - type: "\\b(bool|str|char|((i|u)(8|16|32|64|128|size))|f(16|32|64|128))\\b" - constant.string: start: "[bc]?\""