forked from zyedidia/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rust.yaml
48 lines (40 loc) · 1.16 KB
/
rust.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
filetype: rust
detect:
filename: "\\.rs$"
rules:
# function definition
- identifier: "fn [a-z0-9_]+"
# Reserved words
- statement: "\\b(abstract|alignof|as|become|box|break|const|continue|crate|do|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"
# macros
- special: "[a-z_]+!"
# Constants
- constant: "[A-Z][A-Z_]+"
# Numbers
- constant.number: "\\b[0-9]+\\b"
# Traits/Enums/Structs/Types/etc.
- type: "[A-Z][a-z]+"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "r#+\""
end: "\"#+"
rules: []
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"
- special:
start: "#!\\["
end: "\\]"
rules: []