add syntax highlighting for new rust keywords and types (#3677)
Some checks failed
Build and Test / test (1.19.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.19.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.19.x, windows-latest) (push) Has been cancelled
Build and Test / test (1.23.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.23.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.23.x, windows-latest) (push) Has been cancelled

This commit is contained in:
edwloef 2025-03-01 13:58:30 +01:00 committed by GitHub
parent 272a308275
commit 3c68655f33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]?\""