mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
add syntax highlighting for new rust keywords and types (#3677)
This commit is contained in:
@@ -7,7 +7,7 @@ rules:
|
|||||||
# function definition
|
# function definition
|
||||||
- identifier: "fn [a-z0-9_]+"
|
- identifier: "fn [a-z0-9_]+"
|
||||||
# Reserved words
|
# 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
|
# macros
|
||||||
- special: "[a-z_]+!"
|
- special: "[a-z_]+!"
|
||||||
# Constants
|
# Constants
|
||||||
@@ -19,7 +19,7 @@ rules:
|
|||||||
# Traits/Enums/Structs/Types/etc.
|
# Traits/Enums/Structs/Types/etc.
|
||||||
- type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b"
|
- type: "\\b[A-Z]+[a-zA-Z_0-9]*[a-z]+[a-zA-Z_0-9]*\\b"
|
||||||
# Builtin types that start with lowercase.
|
# 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:
|
- constant.string:
|
||||||
start: "[bc]?\""
|
start: "[bc]?\""
|
||||||
|
|||||||
Reference in New Issue
Block a user