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
custom inline printing
altagos.dev
3 weeks ago
0c6719d7
aa04716e
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
+9
-2
1 changed file
expand all
collapse all
unified
split
pretty.zig
+9
-2
pretty.zig
···
208
209
pub const InnerFmtOptions = struct {
210
skip_type_name: bool = !default_options.show_type_names,
0
211
};
212
213
fn innerFmt(
···
222
if (!opts.skip_type_name)
223
try printType(T, ctx, run, value);
224
225
-
if (std.meta.hasMethod(T, "pretty")) {
226
-
return value.pretty(ctx, run);
0
0
0
0
0
0
227
}
228
229
return switch (info) {
···
208
209
pub const InnerFmtOptions = struct {
210
skip_type_name: bool = !default_options.show_type_names,
211
+
force_inline: bool = false,
212
};
213
214
fn innerFmt(
···
223
if (!opts.skip_type_name)
224
try printType(T, ctx, run, value);
225
226
+
if (ctx.options.struct_inline or opts.force_inline) {
227
+
if (std.meta.hasMethod(T, "prettyInline")) {
228
+
return value.prettyInline(ctx, run);
229
+
}
230
+
} else {
231
+
if (std.meta.hasMethod(T, "pretty")) {
232
+
return value.pretty(ctx, run);
233
+
}
234
}
235
236
return switch (info) {