Skip to content

Commit c685362

Browse files
committed
Add object patterns and conditions for UnitSpecificSounds, Object-ArmorSet, Object-WeaponSet, and Object-Prerequisites. Include weapon types in addmodule-block.
1 parent 87401f6 commit c685362

File tree

1 file changed

+144
-4
lines changed

1 file changed

+144
-4
lines changed

syntaxes/ini.tmLanguage.json

Lines changed: 144 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@
6161
}
6262
},
6363
"patterns": [
64+
{
65+
"include": "#Object-WeaponSet"
66+
},
67+
{
68+
"include": "#Object-ArmorSet"
69+
},
70+
{
71+
"include": "#Object-Prerequisites"
72+
},
73+
{
74+
"include": "#UnitSpecificSounds"
75+
},
76+
{
77+
"include": "#modules"
78+
},
6479
{
6580
"include": "#addmodule-block"
6681
},
@@ -77,6 +92,119 @@
7792
}
7893
]
7994
},
95+
"UnitSpecificSounds": {
96+
"begin": "\\s*\\b(UnitSpecificSounds)\\b",
97+
"beginCaptures": {
98+
"1": {
99+
"name": "keyword.control.ini"
100+
}
101+
},
102+
"end": "\\s*\\b(End)\\b",
103+
"endCaptures": {
104+
"1": {
105+
"name": "keyword.control.ini"
106+
}
107+
},
108+
"patterns": [
109+
{
110+
"include": "#assignment"
111+
},
112+
{
113+
"include": "#inline-comment"
114+
}
115+
]
116+
},
117+
"Object-ArmorSet": {
118+
"begin": "\\s*\\b(ArmorSet)\\b",
119+
"beginCaptures": {
120+
"1": {
121+
"name": "keyword.control.ini"
122+
}
123+
},
124+
"end": "\\s*\\b(End)\\b",
125+
"endCaptures": {
126+
"1": {
127+
"name": "keyword.control.ini"
128+
}
129+
},
130+
"patterns": [
131+
{
132+
"include": "#WeaponArmor-condition"
133+
},
134+
{
135+
"include": "#assignment"
136+
},
137+
{
138+
"include": "#inline-comment"
139+
}
140+
]
141+
},
142+
"Object-WeaponSet": {
143+
"begin": "\\s*\\b(WeaponSet)\\b",
144+
"beginCaptures": {
145+
"1": {
146+
"name": "keyword.control.ini"
147+
}
148+
},
149+
"end": "\\s*\\b(End)\\b",
150+
"endCaptures": {
151+
"1": {
152+
"name": "keyword.control.ini"
153+
}
154+
},
155+
"patterns": [
156+
{
157+
"include": "#WeaponArmor-condition"
158+
},
159+
{
160+
"include": "#assignment"
161+
},
162+
{
163+
"include": "#inline-comment"
164+
}
165+
]
166+
},
167+
"WeaponArmor-condition": {
168+
"match": "\\s*\\b(Conditions)\\s*(\\=)\\s*\\b([Nn][Oo][Nn][Ee]|[Pp][Ll][Aa][Yy][Ee][Rr]_[Uu][Pp][Gg][Rr][Aa][Dd][Ee])\\b",
169+
"captures": {
170+
"1": {
171+
"name": "entity.name.function"
172+
},
173+
"2": {
174+
"name": "keyword.operator.assignment.ini"
175+
},
176+
"3": {
177+
"name": "variable.other.constant.ini"
178+
}
179+
},
180+
"patterns": [
181+
{
182+
"include": "#inline-comment"
183+
}
184+
]
185+
},
186+
"Object-Prerequisites": {
187+
"begin": "\\s*\\b(Prerequisites)\\b",
188+
"beginCaptures": {
189+
"1": {
190+
"name": "keyword.control.ini"
191+
}
192+
},
193+
"end": "\\s*\\b(End)\\b",
194+
"endCaptures": {
195+
"1": {
196+
"name": "keyword.control.ini"
197+
}
198+
},
199+
"patterns": [
200+
{
201+
"include": "#assignment"
202+
},
203+
{
204+
"include": "#inline-comment"
205+
}
206+
]
207+
},
80208
"addmodule-block": {
81209
"begin": "\\s*\\b(AddModule)\\b",
82210
"beginCaptures": {
@@ -318,6 +446,9 @@
318446
},
319447
"end": "(?!\\G)",
320448
"patterns": [
449+
{
450+
"include": "#weapon-types"
451+
},
321452
{
322453
"include": "#locomotor-types"
323454
},
@@ -349,6 +480,10 @@
349480
}
350481
}
351482
},
483+
"weapon-types": {
484+
"match": "\\b(PRIMARY|SECONDARY|TERTIARY)",
485+
"name": "variable.other.constant.ini"
486+
},
352487
"string": {
353488
"begin": "(^[ \\t]+)?(?=[a-zA-Z])",
354489
"beginCaptures": {
@@ -359,7 +494,7 @@
359494
"end": "(?!\\G)",
360495
"patterns": [
361496
{
362-
"match": "[a-zA-Z][ \\._a-zA-Z0-9]*",
497+
"match": "[a-zA-Z][ \\._a-zA-Z0-9:\\+\\-]*",
363498
"name": "string.unquoted.ini"
364499
}
365500
]
@@ -390,12 +525,17 @@
390525
]
391526
},
392527
"double": {
393-
"match": "-?\\d[(\\.\\d]*( \\d[(\\.\\d]*)?",
528+
"match": "-?\\d[(\\.\\d]*( \\d[(\\.\\d]*)*",
394529
"name": "constant.numeric.ini"
395530
},
396531
"boolean": {
397-
"match": "([Yy]es|[Nn]o|[Tt]rue|[Ff]alse)",
398-
"name": "constant.language.boolean.ini"
532+
"match": "\\b([Yy]es|[Nn]o|[Tt]rue|[Ff]alse)\\s*(?![a-zA-Z])",
533+
"name": "constant.language.boolean.ini",
534+
"patterns": [
535+
{
536+
"include": "#string"
537+
}
538+
]
399539
},
400540
"inline-comment": {
401541
"begin": "(^[ \\t]+)?(?=;)",

0 commit comments

Comments
 (0)