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