better prints

This commit is contained in:
uan
2026-02-06 11:38:40 +01:00
parent 5602765b67
commit dee3a5dfed
2 changed files with 7 additions and 3 deletions

View File

@@ -186,17 +186,21 @@ fn (mut g Generator) gen_expr(expr Expr) {
g.out.write_string('printf(\"')
dump(label);
if label != "" {
g.out.write_string('${label}')
g.out.write_string('(${label}')
g.out.write_string(': ');
}
format := get_type_format(expr_type)
g.out.write_string('%${format}\", ')
g.out.write_string('%${format}')
if label != "" {
g.out.write_string(')')
}
g.out.write_string('\", ')
g.gen_expr(inner_expr)
g.out.write_string(');')
}
i++;
if i < expr.exprs.len {
g.out.write_string('printf(\", \");')
g.out.write_string('printf(\" \");')
}
}
g.out.write_string('printf(\"\\n\");\n')

BIN
one

Binary file not shown.