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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
syntax .zig-esc
# TODO: \xNN \u{...}
state esc special
char "nrt'\\\"" END special
noeat END
syntax .zig-string
state string
char '"' END string
char "\n" END error
char "\\" .zig-esc:this
eat this
syntax zig
state start code
char -b iu maybe-int-type
char -b a-z_@ ident
char -b A-Z ident-upper
# char 0 zero
# char 1-9 dec
char \" .zig-string:this
# char \' .c-char:this
str '//' comment
eat this
state ident
char -b a-zA-Z0-9_ this
inlist keyword start
inlist type start
inlist constant start
inlist builtin start
noeat start
state ident-upper ident
char -b a-z class-name-start
char -b A-Z0-9_ ident
noeat start
state class-name-start
recolor class-name
noeat class-name
state class-name
char a-zA-Z0-9_ this
noeat start
state maybe-int-type type
char 1-9 int-type
recolor ident 1
noeat -b ident
state int-type type
char 0-9 this
noeat start
state comment
char "\n" start
eat this
list keyword \
align allowzero and anyframe anytype asm async await break \
catch comptime const continue defer else enum errdefer error \
export extern fn for if inline linksection noalias nosuspend \
or orelse packed pub resume return struct suspend switch test \
threadlocal try union unreachable usingnamespace \
var volatile while
list type \
bool f16 f32 f64 f128 void noreturn type anyerror promise \
i0 u0 isize usize comptime_int comptime_float \
c_short c_ushort c_int c_uint c_long c_ulong c_longlong \
c_ulonglong c_longdouble c_void
list constant \
null undefined true false
list builtin \
@Frame @TagType @This @Type @TypeOf @Vector \
@addWithOverflow @alignCast @alignOf @as @asyncCall \
@atomicLoad @atomicRmw @atomicStore \
@bitCast @bitOffsetOf @bitReverse @boolToInt @breakpoint \
@byteOffsetOf @byteSwap @bytesToSlice @cDefine @cImport \
@cInclude @cUndef @call @ceil @clz @cmpxchgStrong @cmpxchgWeak \
@compileError @compileLog @cos @ctz @divExact @divFloor \
@divTrunc @embedFile @enumToInt @errSetCast @errorName \
@errorReturnTrace @errorToInt @exp @exp2 @export @fabs \
@fence @field @fieldParentPtr @floatCast @floatToInt @floor \
@frame @frameAddress @hasDecl @hasField @import @intCast \
@intToEnum @intToError @intToFloat @intToPtr @log @log2 @log10 \
@memcpy @memset @mod @mulAdd @mulWithOverflow @panic \
@popCount @ptrCast @ptrToInt @reduce @rem @returnAddress @round \
@setAlignStack @setCold @setEvalBranchQuota @setFloatMode \
@setRuntimeSafety @shlExact @shlWithOverflow @shrExact \
@shuffle @splat @sin @src @sizeOf @sliceToBytes @sqrt \
@subWithOverflow @tagName @trunc @truncate \
@typeInfo @typeName @unionInit @wasmMemorySize @wasmMemoryGrow
|