From bcb9d90abb0f97ab286ecca518d856e49865d192 Mon Sep 17 00:00:00 2001 From: krischerven <50562493+krischerven@users.noreply.github.com> Date: Wed, 8 Apr 2020 10:52:07 -0400 Subject: [PATCH] cgen: remove redundant spaces in generated C --- vlib/v/gen/cgen.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 990bf06a4d..7fd62e2a69 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -502,7 +502,7 @@ fn (g mut Gen) for_in(it ast.ForInStmt) { g.expr(it.cond) g.write('; $i < ') g.expr(it.high) - g.writeln('; $i++) { ') + g.writeln('; $i++) {') g.writeln('\tint $it.val_var = $i;') g.stmts(it.stmts) g.writeln('}') @@ -829,7 +829,7 @@ fn (g mut Gen) gen_fn_decl(it ast.FnDecl) { g.writeln(');') return } - g.writeln(') { ') + g.writeln(') {') if !is_main { g.definitions.writeln(');') } @@ -972,7 +972,7 @@ fn (g mut Gen) expr(node ast.Expr) { } else { len := it.exprs.len g.write('new_array_from_c_array($len, $len, sizeof($elem_type_str), ') - g.writeln('($elem_type_str[$len]){\t') + g.write('($elem_type_str[$len]){\n\t\t') for expr in it.exprs { g.expr(expr) g.write(', ')