-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhum.tmLanguage.json
More file actions
72 lines (72 loc) · 2.74 KB
/
Copy pathhum.tmLanguage.json
File metadata and controls
72 lines (72 loc) · 2.74 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
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
{
"name": "Hum",
"scopeName": "source.hum",
"fileTypes": ["hum"],
"patterns": [
{"include": "#comments"},
{"include": "#module"},
{"include": "#items"},
{"include": "#identifiers"},
{"include": "#parameter-permissions"},
{"include": "#callable-types"},
{"include": "#writable-field-aliases"},
{"include": "#typed-failures"},
{"include": "#sections"},
{"include": "#test-modifiers"}
],
"repository": {
"comments": {
"patterns": [
{"name": "comment.line.number-sign.hum", "match": "#.*$"},
{"name": "comment.line.double-slash.hum", "match": "/{2}.*$"}
]
},
"module": {
"patterns": [
{"name": "keyword.control.module.hum", "match": "^[[:space:]]*(module)(?=[^[:alnum:]_]|$)"}
]
},
"items": {
"patterns": [
{"name": "keyword.declaration.item.hum", "match": "^[[:space:]]*(app|type|store|task|test)(?=[^[:alnum:]_]|$)"}
]
},
"identifiers": {
"patterns": [
{"name": "entity.name.namespace.module.hum", "match": "^[[:space:]]*module[[:space:]]+[a-z_][a-z0-9_]*(\\.([a-z_][a-z0-9_]*))*"},
{"name": "entity.name.function.value.hum", "match": "^[[:space:]]*(app|store|task)[[:space:]]+([a-z_][a-z0-9_]*)(?=[^[:alnum:]_]|$)"},
{"name": "entity.name.type.hum", "match": "^[[:space:]]*type[[:space:]]+([A-Z][A-Za-z0-9]*)(?=[^[:alnum:]_]|$)"}
]
},
"parameter-permissions": {
"patterns": [
{"name": "storage.modifier.parameter-permission.hum", "match": "(^|[,(][[:space:]]*)(borrow|change|consume)(?=[[:space:]]+[a-z_][a-z0-9_]*[[:space:]]*:)"}
]
},
"callable-types": {
"patterns": [
{"name": "storage.type.callable.pure.hum", "match": "task[(][[:space:]]*UInt[[:space:]]*[)][[:space:]]+->[[:space:]]+UInt"}
]
},
"typed-failures": {
"patterns": [
{"name": "keyword.control.typed-failure.hum", "match": "(^|[^[:alnum:]_])(try|fail)($|[^[:alnum:]_])"}
]
},
"writable-field-aliases": {
"patterns": [
{"name": "storage.modifier.writable-field-alias.hum", "match": "^[[:space:]]*let[[:space:]]+[a-z_][a-z0-9_]*[[:space:]]*=[[:space:]]*change[[:space:]]+[a-z_][a-z0-9_]*\\.[a-z_][a-z0-9_]*[[:space:]]*$"}
]
},
"sections": {
"patterns": [
{"name": "keyword.other.section.hum", "match": "^[[:space:]]*(why|targets|uses|changes|needs|ensures|protects|trusts|fails[[:space:]]+when|watch[[:space:]]+for|cost|allocates|avoids|tradeoffs|optimizes|tests|does|regression|covers)[[:space:]]*:"}
]
},
"test-modifiers": {
"patterns": [
{"name": "storage.modifier.test.hum", "match": "(^|[^[:alnum:]_])(unit|property|fuzz|regression|integration|model)($|[^[:alnum:]_])"}
]
}
}
}