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