1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Please don't zig fmt this
const std = @import("std");
const Syntax = @import("../Syntax.zig");
// TODO: Add support for the multiline string \\
pub const syntax = Syntax{
.name = "Zig",
.filematch = &[_][]const u8{ ".zig" },
.keywords1 = &[_][]const u8{
"align", "allowzero", "and", "anyframe", "anytype", "asm", "async", "await", "break", "catch", "comptime",
"const", "continue", "defer", "else", "enum", "errdefer", "error", "export", "extern", "false", "fn", "for", "if",
"inline", "noalias", "nosuspend", "null", "or", "orelse", "packed", "pub", "resume", "return", "linksection",
"struct", "suspend", "switch", "test", "threadlocal", "true", "try", "undefined", "union", "unreachable",
"usingnamespace", "var", "volatile", "while",
"opaque",
},
.keywords2 = &[_][]const u8{
// TODO: Generate all integer types with a comptime fn.
"i8", "u8", "i16", "u16", "i32", "u32", "i64", "u64", "i128", "u128", "isize", "usize", "c_short", "c_ushort",
"c_int", "c_uint", "c_long", "c_ulong", "c_longlong", "c_ulonglong", "c_longdouble", "c_void", "f16", "f32",
"f64", "f128", "bool", "void", "noreturn", "type", "anyerror", "comptime_int", "comptime_float",
"@addWithOverflow", "@alignCast", "@alignOf", "@as", "@asyncCall", "@atomicLoad", "@atomicRmw", "@atomicStore",
"@bitCast", "@bitOffsetOf", "@boolToInt", "@bitSizeOf", "@breakpoint", "@mulAdd", "@byteSwap", "@bitReverse",
"@offsetOf", "@call", "@cDefine", "@cImport", "@cInclude", "@clz", "@cmpxchgStrong", "@cmpxchgWeak",
"@compileError", "@compileLog", "@ctz", "@cUndef", "@divExact", "@divFloor", "@divTrunc", "@embedFile",
"@enumToIt", "@errorName", "@errorReturnTrace", "@errorToInt", "@errSetCast", "@export", "@extern", "@fence",
"@field", "@fieldParentPtr", "@floatCast", "@floatToInt", "@frame", "@Frame", "@frameAddress", "@frameSize",
"@hasDecl", "@hasField", "@import", "@intCast", "@intToEnum", "@intToError" , "@intToFloat", "@intToPtr",
"@maximum", "@memcpy", "@memset", "@minimum", "@wasmMemorySize", "@wasmMemoryGrow", "@mod", "@mulWithOverflow",
"@panic", "@popCount", "@prefetch", "@ptrCast", "@ptrToInt", "@rem", "@returnAddress", "@select",
"@setAlignStack", "@setCold", "@setEvalBranchQuota", "@setFloatMode", "@setRuntimeSafety", "@shlExact",
"@shlWithOverflow", "@shrExact", "@shuffle", "@sizeOf", "@splat", "@reduce", "@src", "@sqrt", "@sin", "@cos",
"@exp", "@exp2", "@log", "@log2", "@log10", "@fabs", "@floor", "@ceil", "@trunc", "@round", "@subWithOverflow",
"@tagName", "@This", "@truncate", "@Type", "@typeInfo", "@typeName", "@TypeOf", "@unionInit",
},
.singleline_comment_start = "//",
.multiline_comment_start = null,
.multiline_comment_end = null,
.separators = "&*^:,.=!<{[(-%|+?>}]);/~",
.flags = .{ .hl_numbers = true, .hl_strings = true },
};
|