Skip to content

Commit 975bb33

Browse files
authored
Merge pull request #2 from bitloops/enrich-tmlanguage
Add operators, reserved words and so on
2 parents 79119c6 + d6941c3 commit 975bb33

File tree

1 file changed

+95
-45
lines changed

1 file changed

+95
-45
lines changed

syntaxes/bitloops.tmLanguage.json

Lines changed: 95 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,103 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3-
"name": "Bitloops",
4-
"patterns": [
5-
{
6-
"include": "#keywords"
7-
},
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "Bitloops",
4+
"patterns": [
85
{
9-
"include": "#numeric"
10-
},
11-
{
12-
"include": "#strings"
13-
},
6+
"include": "#keywords"
7+
},
8+
{
9+
"include": "#numeric"
10+
},
11+
{
12+
"include": "#strings"
13+
},
14+
{
15+
"include": "#storage"
16+
},
1417
{
15-
"include": "#comments"
16-
},
18+
"include": "#variables"
19+
},
20+
{
21+
"include": "#comments"
22+
},
1723
{
18-
"include": "#bitloopsClasses"
19-
},
24+
"include": "#bitloopsClasses"
25+
},
2026
{
21-
"include": "#myClasses"
22-
}
23-
],
24-
"repository": {
25-
"keywords": {
26-
"patterns": [{
27-
"name": "keyword.control.bitloops",
28-
"match": "\\b(const|let|continue|break|return|concretes|implements|extends)\\b"
29-
}]
30-
},
27+
"include": "#myClasses"
28+
}
29+
],
30+
"repository": {
31+
"keywords": {
32+
"patterns": [
33+
{
34+
"name": "keyword.control.bitloops",
35+
"match": "\\b(const|let|continue|break|return|concretes|implements|extends|if|isBrokenIf)\\b"
36+
},
37+
{
38+
"name": "keyword.operator.comparison.bitloops",
39+
"match": "==|!="
40+
},
41+
{
42+
"name": "keyword.operator.relational.bitloops",
43+
"match": "<=|>=|<|>"
44+
},
45+
{
46+
"name": "keyword.operator.logical.bitloops",
47+
"match": "NOT|OR|AND"
48+
},
49+
{
50+
"name": "keyword.operator.arithmetic.bitloops",
51+
"match": "%|\\*|/|-|\\+"
52+
}
53+
]
54+
},
3155
"numeric": {
32-
"patterns": [{
33-
"name": "constant.numeric.bitloops",
34-
"match": "\\b(0x[0-9a-fA-F]+|0b[01]+|\\d+)\\b"
35-
}]
56+
"patterns": [
57+
{
58+
"name": "constant.numeric.bitloops",
59+
"match": "\\b(0x[0-9a-fA-F]+|0b[01]+|\\d+)\\b"
60+
}
61+
]
3662
},
3763
"bitloopsClasses": {
38-
"patterns": [{
39-
"name": "keyword.control.templateClass.bitloops",
40-
"match": "\\b(Config|(REST\\.Methods)|REST|DTO|UseCase|Aggregate|Entity|OK|Errors|ValueObject|Props|RESTController|RESTRouter|GraphQLController|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|ApplicationErrors|DomainErrors|DomainError|ApplicationError)\\b"
41-
}]
42-
},
64+
"patterns": [
65+
{
66+
"name": "keyword.control.templateClass.bitloops",
67+
"match": "\\b(Config|(REST\\.Methods)|REST|DTO|UseCase|Root|Entity|Rule|OK|Errors|ValueObject|Props|RESTController|RESTRouter|GraphQLController|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|ApplicationErrors|DomainErrors|DomainError|ApplicationError)\\b"
68+
}
69+
]
70+
},
4371
"myClasses": {
44-
"patterns": [{
45-
"name": "entity.name.class.bitloops",
46-
"match": "\\b[A-Z]+[a-zA-Z0-9]*(DTO|UseCase|Aggregate|VO|Entity|Error|Controller|Router|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|Error)\\b"
47-
}]
48-
},
49-
"strings": {
50-
"patterns": [
72+
"patterns": [
73+
{
74+
"name": "entity.name.class.bitloops",
75+
"match": "\\b[A-Z]+[a-zA-Z0-9]*(DTO|UseCase|Aggregate|VO|Entity|Error|Controller|Router|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|Error)\\b"
76+
}
77+
]
78+
},
79+
"storage": {
80+
"patterns": [
81+
{
82+
"name": "storage.type.bitloops",
83+
"match": "\\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes|timestamp)\\b"
84+
},
85+
{
86+
"name": "storage.modifier.bitloops",
87+
"match": "\\b(optional|required|public|private)\\b"
88+
}
89+
]
90+
},
91+
"variables": {
92+
"patterns": [
93+
{
94+
"name": "variable.language.bitloops",
95+
"match": "\\b(this)\\b"
96+
}
97+
]
98+
},
99+
"strings": {
100+
"patterns": [
51101
{
52102
"name": "string.quoted.double.bitloops",
53103
"begin": "\"",
@@ -64,7 +114,7 @@
64114
"end": "`"
65115
}
66116
]
67-
},
117+
},
68118
"comments": {
69119
"patterns": [
70120
{
@@ -78,6 +128,6 @@
78128
}
79129
]
80130
}
81-
},
82-
"scopeName": "source.bitloops"
83-
}
131+
},
132+
"scopeName": "source.bitloops"
133+
}

0 commit comments

Comments
 (0)