-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfuthark.tmLanguage.json
59 lines (59 loc) · 2.01 KB
/
futhark.tmLanguage.json
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
{
"scopeName": "source.futhark",
"patterns": [{ "include": "#expression"}],
"repository": {
"expression": {
"patterns": [
{ "include": "#paren-expression" },
{ "include": "#comment"},
{ "include": "#keyword"},
{ "include": "#number" }
]
},
"paren-expression": {
"begin": "\\(",
"end": "\\)",
"beginCaptures": {
"0": { "name": "punctuation.paren.open" }
},
"endCaptures": {
"0": { "name": "punctuation.paren.close" }
},
"name": "expression.group",
"patterns": [{ "include": "#expression" }]
},
"comment": {
"name": "comment",
"begin": "--",
"end": "\n"
},
"keyword": {
"name": "keyword",
"match": "\\b(if|then|else|let|loop|in|with|type|val|entry|for|while|do|case|match|include|import|module|open|local|assert|def)\\b"
},
"number": {
"patterns": [
{"include": "#decimal"},
{"include": "#hexadecimal"},
{"include": "#hexfloat"},
{"include": "#binary"}
]
},
"decimal": {
"name": "constant.numeric.decimal",
"match": "\\b[0-9][0-9_]*(\\.[0-9]+)?(i8|i16|i32|i64|u8|u16|u32|u64|f16|f32|f64)?\\b"
},
"binary": {
"name": "constant.numeric.binary",
"match": "\\b0[bB][01][01_]*(i8|i16|i32|i64|u8|u16|u32|u64|f16|f32|f64)?\\b"
},
"hexadecimal": {
"name": "constant.numeric.hexadecimal",
"match": "\\b0[xX][0-9a-fA-F][0-9a-fA-F_]*(\\.[0-9a-fA-F]+)(i8|i16|i32|i64|u8|u16|u32|u64|f16|f32|f64)?\\b"
},
"hexfloat": {
"name": "constant.numeric.hexfloat",
"match": "\\b0[xX][0-9a-fA-F][0-9a-fA-F_]*\\.[0-9a-fA-F][0-9a-fA-F_]*([pP][\\+\\-]?[0-9_]+)(i8|i16|i32|i64|u8|u16|u32|u64|f16|f32|f64)?\\b"
}
}
}