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
208
209
209
pub const InnerFmtOptions = struct {
210
210
skip_type_name: bool = !default_options.show_type_names,
211
211
+
force_inline: bool = false,
211
212
};
212
213
213
214
fn innerFmt(
···
222
223
if (!opts.skip_type_name)
223
224
try printType(T, ctx, run, value);
224
225
225
225
-
if (std.meta.hasMethod(T, "pretty")) {
226
226
-
return value.pretty(ctx, run);
226
226
+
if (ctx.options.struct_inline or opts.force_inline) {
227
227
+
if (std.meta.hasMethod(T, "prettyInline")) {
228
228
+
return value.prettyInline(ctx, run);
229
229
+
}
230
230
+
} else {
231
231
+
if (std.meta.hasMethod(T, "pretty")) {
232
232
+
return value.pretty(ctx, run);
233
233
+
}
227
234
}
228
235
229
236
return switch (info) {