This repository has been archived by the owner on Apr 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Rust.JSON-tmLanguage
97 lines (97 loc) · 3.99 KB
/
Rust.JSON-tmLanguage
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{ "name": "Rust",
"scopeName": "source.rust",
"fileTypes": ["rs", "rc"],
"foldingStartMarker": "^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$",
"foldingStopMarker": "^\\s*\\}",
"patterns": [
{"name": "variable.other.source.rust",
"match": "'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])"
},
{"name": "string.quoted.single.source.rust",
"begin": "'",
"end": "'",
"patterns": [
{"include": "#rust_escaped_character"}
]
},
{"name": "string.quoted.double.source.rust",
"begin": "\"",
"end": "\"",
"patterns": [
{"include": "#rust_escaped_character"}
]
},
{"name": "meta.function.source.rust",
"match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]?[\\w\\:,+ \\'<>]*)\\s*(\\()",
"captures": {
"1": {"name": "keyword.source.rust"},
"2": {"name": "entity.name.function.source.rust"},
"3": {"name": "keyword.operator.rust"}
}
},
{"name": "keyword.source.rust",
"match": "\\b(as|break|claim|const|copy|Copy|do|drop|else|extern|for|if|impl|in|let|loop|match|mod|mut|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|type)\\b"
},
{"name": "storage.type.source.rust",
"match": "\\b(Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|Option|Either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b"
},
{"name": "variable.language.source.rust",
"match": "\\bself\\b"
},
{"name": "constant.language.source.rust",
"match": "\\b(true|false|Some|None|Left|Right|Ok|Err)\\b"
},
{"name": "support.constant.source.rust",
"match": "\\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b"
},
{"name": "comment.block.preprocessor.rust",
"match": "^(\\w\\(\\w\\)*!)|(#\\[[\\w=\\(\\)_]+\\])$"
},
{"name": "keyword.operator.rust",
"match": "\\{|\\}"
},
{"name": "keyword.operator.rust",
"match": "\\[|\\]"
},
{"name": "keyword.operator.rust",
"match": "\\(|\\)"
},
{"name": "constant.numeric.integer.source.rust",
"match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.hex.source.rust",
"match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.binary.source.rust",
"match": "\\b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i|i8|i16|i32|i64)))\\b"
},
{"name": "constant.numeric.float.source.rust",
"match": "([0-9][0-9_]*(f32|f64|f))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+)|([0-9][0-9_]*\\.[0-9_]+(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+)(f32|f64|f))"
},
{"name": "comment.line.documentation.source.rust",
"begin": "//!",
"end": "$\\n"
},
{"name": "comment.line.double-dash.source.rust",
"begin": "//",
"end": "$\\n"
},
{"name": "comment.block.source.rust",
"begin": "/\\*",
"end": "\\*/"
},
{"name": "keyword.operator.rust",
"match": "(=>)|(->)|[-:=*,!.+|%/&~@<>;]"
},
{"name": "support.function.rust",
"match": "_"
}
],
"repository": {
"rust_escaped_character": {
"name": "constant.character.escape.source.rust",
"match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)"
}
},
"uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d"
}