tangled
alpha
login
or
join now
altagos.dev
/
pretty
0
fork
atom
A pretty printer for zig
zig
0
fork
atom
overview
issues
pulls
pipelines
reorder
altagos.dev
1 month ago
6da8186d
07bf4d26
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
+22
-23
1 changed file
expand all
collapse all
unified
split
pretty.zig
+22
-23
pretty.zig
···
21
21
22
22
inline_arrays: bool = false,
23
23
always_show_index: bool = false,
24
24
+
treat_u8_arrays_as_strings: bool = true,
24
25
25
26
inline_structs: bool = false,
26
27
27
28
show_type_names: bool = true,
28
29
always_show_type_names: bool = false,
29
29
-
30
30
-
treat_u8_arrays_as_strings: bool = true,
31
30
32
31
theme: Theme = .{},
33
32
};
···
246
245
run.resetColor();
247
246
}
248
247
248
248
+
inline fn formatType(
249
249
+
comptime ctx: Context,
250
250
+
run: *const Runtime,
251
251
+
value: type,
252
252
+
) !void {
253
253
+
run.setColor(ctx, .type);
254
254
+
run.setColorRaw(.bold);
255
255
+
try run.write(@typeName(value));
256
256
+
run.resetColor();
257
257
+
}
258
258
+
259
259
+
inline fn formatValue(
260
260
+
comptime ctx: Context,
261
261
+
run: *const Runtime,
262
262
+
value: anytype,
263
263
+
) !void {
264
264
+
run.setColor(ctx, .value);
265
265
+
try run.print("{}", .{value});
266
266
+
run.resetColor();
267
267
+
}
268
268
+
249
269
inline fn formatOptional(
250
270
comptime T: type,
251
271
comptime ctx: Context,
···
378
398
val,
379
399
.{ .skip_type_name = true },
380
400
);
381
381
-
}
382
382
-
383
383
-
inline fn formatType(
384
384
-
comptime ctx: Context,
385
385
-
run: *const Runtime,
386
386
-
value: type,
387
387
-
) !void {
388
388
-
run.setColor(ctx, .type);
389
389
-
run.setColorRaw(.bold);
390
390
-
try run.write(@typeName(value));
391
391
-
run.resetColor();
392
392
-
}
393
393
-
394
394
-
inline fn formatValue(
395
395
-
comptime ctx: Context,
396
396
-
run: *const Runtime,
397
397
-
value: anytype,
398
398
-
) !void {
399
399
-
run.setColor(ctx, .value);
400
400
-
try run.print("{}", .{value});
401
401
-
run.resetColor();
402
401
}
403
402
404
403
inline fn formatFn(