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:
347347 match : ' (?<!\w|\)|\?|\}|\]|\*)(\.(?:[a-zA-Z_]\w*\b|@\"[^\"]*\"))(?!\(|\s*=[^=>])'
348348 name : constant.language.enum
349349
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+
350365 dummy_main :
351366 patterns :
352367 - include : ' #label'
@@ -366,3 +381,4 @@ repository:
366381 - include : ' #function_def'
367382 - include : ' #function_call'
368383 - include : ' #enum_literal'
384+ - include : ' #variables'
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ contexts:
9999 - include : function_def
100100 - include : function_call
101101 - include : enum_literal
102+ - include : variables
102103 enum_literal :
103104 - match : ' (^|\s+)(\.(?:[a-zA-Z_]\w*\b|@\"[^\"]*\"))(?!\(|\s*=[^=>])'
104105 scope : constant.language.enum
@@ -270,3 +271,16 @@ contexts:
270271 support :
271272 - match : ' @[^\"\d][a-zA-Z_]\w*\b'
272273 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 310310 <key >include </key >
311311 <string >#enum_literal </string >
312312 </dict >
313+ <dict >
314+ <key >include </key >
315+ <string >#variables </string >
316+ </dict >
313317 </array >
314318 </dict >
315319 <key >enum_literal </key >
837841 <key >name </key >
838842 <string >support.function.zig </string >
839843 </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 >
840876 </dict >
841877 <key >scopeName </key >
842878 <string >source.zig </string >
You can’t perform that action at this time.
0 commit comments