-
This commit is contained in:
10
generator.v
10
generator.v
@@ -176,24 +176,14 @@ fn (mut g Generator) gen_expr(expr Expr) {
|
|||||||
label := g.get_print_label(inner_expr);
|
label := g.get_print_label(inner_expr);
|
||||||
if g.symbols.lookup_class(expr_type) != none {
|
if g.symbols.lookup_class(expr_type) != none {
|
||||||
class_name := mangle_struct(expr_type)
|
class_name := mangle_struct(expr_type)
|
||||||
/*if label != "" {
|
|
||||||
g.out.write_string('${label}: ");')
|
|
||||||
}*/
|
|
||||||
g.out.write_string('print_${class_name}(')
|
g.out.write_string('print_${class_name}(')
|
||||||
g.gen_expr(inner_expr)
|
g.gen_expr(inner_expr)
|
||||||
g.out.write_string(', 0);')
|
g.out.write_string(', 0);')
|
||||||
} else {
|
} else {
|
||||||
g.out.write_string('printf(\"')
|
g.out.write_string('printf(\"')
|
||||||
dump(label);
|
dump(label);
|
||||||
if label != "" {
|
|
||||||
g.out.write_string('(${label}')
|
|
||||||
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.out.write_string('\", ')
|
||||||
g.gen_expr(inner_expr)
|
g.gen_expr(inner_expr)
|
||||||
g.out.write_string(');')
|
g.out.write_string(');')
|
||||||
|
|||||||
Reference in New Issue
Block a user