-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrib-grammar.json
More file actions
46 lines (46 loc) · 1.36 KB
/
rib-grammar.json
File metadata and controls
46 lines (46 loc) · 1.36 KB
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
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Rib",
"scopeName": "source.rib",
"patterns": [
{ "include": "#keywords" },
{ "include": "#operators" },
{ "include": "#literals" },
{ "include": "#types" },
{ "include": "#identifiers" }
],
"repository": {
"keywords": {
"patterns": [
{
"match": "\\b(let|if|then|else|for|in|yield|reduce|from|some|none|ok|error|instance)\\b",
"name": "keyword.control.rib"
}
]
},
"operators": {
"patterns": [
{ "match": "\\b(>=|<=|==|<|>|&&|\\|\\||\\+|\\-|\\*|/)\\b", "name": "keyword.operator.rib" },
{ "match": "\\.{2,3}=?", "name": "keyword.operator.range.rib" }
]
},
"literals": {
"patterns": [
{ "match": "\\b(true|false)\\b", "name": "constant.language.boolean.rib" },
{ "match": "\\d+", "name": "constant.numeric.rib" },
{ "match": "\"(\\\\.|[^\"])*\"", "name": "string.quoted.double.rib" }
]
},
"types": {
"patterns": [
{
"match": "\\b(bool|s8|u8|s16|u16|s32|u32|s64|u64|f32|f64|char|string|list|tuple|option|result)\\b",
"name": "storage.type.rib"
}
]
},
"identifiers": {
"patterns": [{ "match": "[a-zA-Z_][a-zA-Z0-9_-]*", "name": "variable.rib" }]
}
}
}