Skip to content

Commit 3c68655

Browse files
authored
add syntax highlighting for new rust keywords and types (micro-editor#3677)
1 parent 272a308 commit 3c68655

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

runtime/syntax/rust.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rules:
77
# function definition
88
- identifier: "fn [a-z0-9_]+"
99
# Reserved words
10-
- 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"
10+
- 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"
1111
# macros
1212
- special: "[a-z_]+!"
1313
# Constants
@@ -19,7 +19,7 @@ rules:
1919
# Traits/Enums/Structs/Types/etc.
2020
- type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b"
2121
# Builtin types that start with lowercase.
22-
- type: "\\b(bool|str|isize|usize|((i|u)(8|16|32|64))|f32|f64)\\b"
22+
- type: "\\b(bool|str|char|((i|u)(8|16|32|64|128|size))|f(16|32|64|128))\\b"
2323

2424
- constant.string:
2525
start: "[bc]?\""

0 commit comments

Comments
 (0)