fix newline being added when using print with int

pull/2258/head
joe-conigliaro 2019-10-08 17:52:11 +11:00 committed by Alexander Medvednikov
parent 0963328aed
commit b4bf12378e
1 changed files with 2 additions and 1 deletions

View File

@ -911,7 +911,8 @@ fn (p mut Parser) fn_call_args(f mut Fn) &Fn {
$if !js {
fmt := p.typ_to_fmt(typ, 0)
if fmt != '' {
p.cgen.resetln(p.cgen.cur_line.replace(f.name + ' (', '/*opt*/printf ("' + fmt + '\\n", '))
nl := if f.name == 'println' { '\\n' } else { '' }
p.cgen.resetln(p.cgen.cur_line.replace(f.name + ' (', '/*opt*/printf ("' + fmt + '$nl", '))
continue
}
}