1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix indent in for_in_string (#5631)

This commit is contained in:
yuyi
2020-07-04 00:10:45 +08:00
committed by GitHub
parent 61213263cd
commit 67e85fa9dd

View File

@@ -894,7 +894,7 @@ fn (mut g Gen) for_in(it ast.ForInStmt) {
g.write('for (int $i = 0; $i < ')
g.expr(it.cond)
g.writeln('.len; ++$i) {')
g.write('$styp ${c_name(it.val_var)} = ')
g.write('\t$styp ${c_name(it.val_var)} = ')
g.expr(it.cond)
g.writeln('.args[$i];')
g.stmts(it.stmts)
@@ -905,7 +905,7 @@ fn (mut g Gen) for_in(it ast.ForInStmt) {
g.expr(it.cond)
g.writeln('.len; ++$i) {')
if it.val_var != '_' {
g.write('byte ${c_name(it.val_var)} = ')
g.write('\tbyte ${c_name(it.val_var)} = ')
g.expr(it.cond)
g.writeln('.str[$i];')
}