better prints
This commit is contained in:
10
generator.v
10
generator.v
@@ -186,17 +186,21 @@ fn (mut g Generator) gen_expr(expr Expr) {
|
|||||||
g.out.write_string('printf(\"')
|
g.out.write_string('printf(\"')
|
||||||
dump(label);
|
dump(label);
|
||||||
if label != "" {
|
if label != "" {
|
||||||
g.out.write_string('${label}')
|
g.out.write_string('(${label}')
|
||||||
g.out.write_string(': ');
|
g.out.write_string(': ');
|
||||||
}
|
}
|
||||||
format := get_type_format(expr_type)
|
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.gen_expr(inner_expr)
|
||||||
g.out.write_string(');')
|
g.out.write_string(');')
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
if i < expr.exprs.len {
|
if i < expr.exprs.len {
|
||||||
g.out.write_string('printf(\", \");')
|
g.out.write_string('printf(\" \");')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g.out.write_string('printf(\"\\n\");\n')
|
g.out.write_string('printf(\"\\n\");\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user