File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,21 @@ repository:
347
347
match : ' (?<!\w|\)|\?|\}|\]|\*)(\.(?:[a-zA-Z_]\w*\b|@\"[^\"]*\"))(?!\(|\s*=[^=>])'
348
348
name : constant.language.enum
349
349
350
+ variables :
351
+ name : meta.variable.zig
352
+ patterns :
353
+ - match : ' \b[_A-Z][_A-Z0-9]+\b'
354
+ name : variable.constant.zig
355
+
356
+ - match : ' \b[_a-zA-Z][_a-zA-Z0-9]*_t\b'
357
+ name : entity.name.type.zig
358
+
359
+ - match : ' \b[A-Z][a-zA-Z0-9]*\b'
360
+ name : entity.name.type.zig
361
+
362
+ - match : ' \b[_a-zA-Z][_a-zA-Z0-9]*\b'
363
+ name : variable.zig
364
+
350
365
dummy_main :
351
366
patterns :
352
367
- include : ' #label'
@@ -366,3 +381,4 @@ repository:
366
381
- include : ' #function_def'
367
382
- include : ' #function_call'
368
383
- include : ' #enum_literal'
384
+ - include : ' #variables'
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ contexts:
99
99
- include : function_def
100
100
- include : function_call
101
101
- include : enum_literal
102
+ - include : variables
102
103
enum_literal :
103
104
- match : ' (^|\s+)(\.(?:[a-zA-Z_]\w*\b|@\"[^\"]*\"))(?!\(|\s*=[^=>])'
104
105
scope : constant.language.enum
@@ -270,3 +271,16 @@ contexts:
270
271
support :
271
272
- match : ' @[^\"\d][a-zA-Z_]\w*\b'
272
273
scope : support.function.zig
274
+ variables :
275
+ - match : ' \b[_A-Z][_A-Z0-9]+\b'
276
+ scope : variable.constant.zig
277
+
278
+ - match : ' \b[_a-zA-Z][_a-zA-Z0-9]*_t\b'
279
+ scope : entity.name.type.zig
280
+
281
+ - match : ' \b[A-Z][a-zA-Z0-9]*\b'
282
+ scope : entity.name.type.zig
283
+
284
+ - match : ' \b[_a-zA-Z][_a-zA-Z0-9]*\b'
285
+ scope : variable.zig
286
+
Original file line number Diff line number Diff line change 310
310
<key >include </key >
311
311
<string >#enum_literal </string >
312
312
</dict >
313
+ <dict >
314
+ <key >include </key >
315
+ <string >#variables </string >
316
+ </dict >
313
317
</array >
314
318
</dict >
315
319
<key >enum_literal </key >
837
841
<key >name </key >
838
842
<string >support.function.zig </string >
839
843
</dict >
844
+ <key >variables </key >
845
+ <dict >
846
+ <key >name </key >
847
+ <string >meta.variable.zig </string >
848
+ <key >patterns </key >
849
+ <array >
850
+ <dict >
851
+ <key >match </key >
852
+ <string >\b[_A-Z][_A-Z0-9]+\b </string >
853
+ <key >name </key >
854
+ <string >variable.constant.zig </string >
855
+ </dict >
856
+ <dict >
857
+ <key >match </key >
858
+ <string >\b[_a-zA-Z][_a-zA-Z0-9]*_t\b </string >
859
+ <key >name </key >
860
+ <string >entity.name.type.zig </string >
861
+ </dict >
862
+ <dict >
863
+ <key >match </key >
864
+ <string >\b[A-Z][a-zA-Z0-9]*\b </string >
865
+ <key >name </key >
866
+ <string >entity.name.type.zig </string >
867
+ </dict >
868
+ <dict >
869
+ <key >match </key >
870
+ <string >\b[_a-zA-Z][_a-zA-Z0-9]*\b </string >
871
+ <key >name </key >
872
+ <string >variable.zig </string >
873
+ </dict >
874
+ </array >
875
+ </dict >
840
876
</dict >
841
877
<key >scopeName </key >
842
878
<string >source.zig </string >
You can’t perform that action at this time.
0 commit comments