Skip to content

Commit 3ef8ac2

Browse files
committed
map various keywords to zigStorageClass that links to StorageClass
- volatile, linksection and allowzero obviously aren't types. The differentiation between what is mapped to "StorageClass" or "PreProc" isn't very clear. At least it's less scattered than the previous mappings.
1 parent 537c1cf commit 3ef8ac2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

syntax/zig.vim

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set cpo&vim
1212

1313
syntax keyword zigBoolean true false
1414
syntax keyword zigNull null
15-
syntax keyword zigType bool void type anytype anyerror anyframe volatile linksection noreturn allowzero anyopaque
15+
syntax keyword zigType bool void type anytype anyerror anyframe noreturn anyopaque
1616
syntax keyword zigType i0 u0 isize usize comptime_int comptime_float
1717
syntax keyword zigType f16 f32 f64 f80 f128
1818
syntax keyword zigType c_char c_short c_ushort c_int c_uint c_long c_ulong c_longlong c_ulonglong c_longdouble
@@ -22,13 +22,12 @@ syntax keyword zigRepeat while for
2222
syntax keyword zigComparatorWord and or orelse
2323
syntax keyword zigStructure struct enum union error packed opaque
2424
syntax keyword zigException error
25-
syntax keyword zigStorageClass
25+
syntax keyword zigStorageClass addrspace align allowzero callconv extern export linksection threadlocal volatile
2626
syntax keyword zigDummyVariable _
2727
syntax keyword zigKeyword var const fn try test pub comptime
2828
syntax keyword zigStatement return break continue asm defer errdefer
29-
syntax keyword zigMacro export extern
3029
syntax keyword zigAsync nosuspend suspend resume
31-
syntax keyword zigPreProc addrspace align callconv catch inline noalias noinline threadlocal
30+
syntax keyword zigPreProc catch inline noalias noinline
3231
syntax keyword zigBuiltinFn @addrSpaceCast @addWithOverflow @alignCast @alignOf @as @atomicLoad @atomicRmw @atomicStore @bitCast @bitOffsetOf @bitSizeOf @branchHint @breakpoint @mulAdd @byteSwap @bitReverse @offsetOf @call @cDefine @cImport @cInclude @clz @cmpxchgStrong @cmpxchgWeak @compileError @compileLog @constCast @ctz @cUndef @cVaArg @cVaCopy @cVaEnd @cVaStart @disableInstrumentation @disableIntrinsics @divExact @divFloor @divTrunc @embedFile @enumFromInt @errorFromInt @errorName @errorReturnTrace @errorCast @export @extern @field @fieldParentPtr @FieldType @floatCast @floatFromInt @frameAddress @hasDecl @hasField @import @inComptime @intCast @intFromBool @intFromEnum @intFromError @intFromFloat @intFromPtr @max @memcpy @memmove @memset @min @wasmMemorySize @wasmMemoryGrow @mod @mulWithOverflow @panic @popCount @prefetch @ptrCast @ptrFromInt @rem @returnAddress @select @setEvalBranchQuota @setFloatMode @setRuntimeSafety @shlExact @shlWithOverflow @shrExact @shuffle @sizeOf @splat @reduce @src @sqrt @sin @cos @tan @exp @exp2 @log @log2 @log10 @abs @floor @ceil @trunc @round @subWithOverflow @tagName @This @trap @truncate @Type @typeInfo @typeName @TypeOf @unionInit @Vector @volatileCast @workGroupId @workGroupSize @workItemId
3332

3433
syntax match zigType "\v<[iu][1-9]\d*>"
@@ -92,12 +91,12 @@ highlight default link zigNumber Number
9291
highlight default link zigArrowCharacter zigOperator
9392
highlight default link zigOperator Operator
9493
highlight default link zigStructure Structure
95-
highlight default link zigMacro Macro
9694
highlight default link zigStatement Statement
9795
highlight default link zigConditional Conditional
9896
highlight default link zigComparatorWord zigStatement
9997
highlight default link zigRepeat Repeat
10098
highlight default link zigSpecial Special
99+
highlight default link zigStorageClass StorageClass
101100
highlight default link zigAsync Keyword
102101
highlight default link zigPreProc PreProc
103102
highlight default link zigException Exception

0 commit comments

Comments
 (0)