This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
grammar-func.json
107 lines (107 loc) · 2.3 KB
/
grammar-func.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
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
98
99
100
101
102
103
104
105
106
107
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "FunC",
"foldingStartMarker": "\\{\\s*$",
"foldingStopMarker": "^\\s*\\}",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#directives"
},
{
"include": "#numeric"
},
{
"include": "#comments"
},
{
"include": "#storage"
},
{
"include": "#functions"
},
{
"include": "#variables"
}
],
"repository": {
"keywords": {
"patterns": [{
"name": "keyword.control.",
"match": "\\b(if|ifnot|else|elseif|elseifnot|while|do|until|repeat|return|impure|method_id|forall|asm|inline|inline_ref)\\b"
}, {
"name": "keyword.operator",
"match": "(?<=\\s)(<=>|>=|<=|!=|==|\\^>>|\\~>>|>>|<<|\\/%|\\^%|\\~%|\\^\\/|\\~\\/|\\+=|-=|\\*=|\\/=|~\\/=|\\^\\/=|%=|\\^%=|<<=|>>=|~>>=|\\^>>=|&=|\\|=|\\^=|\\^|=|~|\\/|%|-|\\*|\\+|>|<|&|\\||:|\\?)(?=\\s)"
}, {
"name": "keyword.other",
"match": "\\b(false|true)\\b"
}]
},
"directives": {
"name": "storage.modifier.import",
"begin": "#include|#pragma",
"end": ";",
"patterns": [{
"begin": "\"",
"end": "\"",
"name": "string.quoted.double"
}, {
"match": "(>=|<=|=|>|<|\\^)?([0-9]+)(.[0-9]+)?(.[0-9]+)?",
"name": "constant.numeric"
}]
},
"strings": {
"name": "string.quoted.double.",
"begin": "\"",
"end": "\"(H|h|c|u|s|a)?"
},
"numeric": {
"name": "constant.numeric",
"match": "(-?([\\d]+|0x[\\da-fA-F]+))\\b"
},
"comments": {
"patterns": [
{
"name": "comment.line",
"match": ";;(.*)"
},
{
"name": "comment.block",
"begin": "{-",
"end": "-}"
}
]
},
"storage": {
"patterns": [{
"name": "storage.type",
"match": "\\b(var|int|slice|tuple|cell|builder|cont|_)(?=[\\s\\),\\[\\]])"
}, {
"name": "storage.modifier",
"match": "\\b(global|const)\\s"
}]
},
"variables": {
"patterns": [
{
"match": "(?!\")(`([^`]+)`|((?=_)_|(?={){|(?=})}|(?![_`{}]))([^;,\\[\\]\\(\\)\\s~.]+))",
"name": "variable.name"
}
]
},
"functions": {
"patterns": [
{
"match": "(?!\")(`([^`]+)`|(\\.|~)?((?=_)_|(?={){|(?=})}|(?![_`{}]))([^;,\\[\\]\\(\\)\\s~.]+))(?=[\\(])",
"name": "entity.name.function"
}
]
}
},
"scopeName": "source.func"
}