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

fix newline being added when using print with int

This commit is contained in:
joe-conigliaro 2019-10-08 17:52:11 +11:00 committed by Alexander Medvednikov
parent 0963328aed
commit b4bf12378e

View File

@ -911,7 +911,8 @@ fn (p mut Parser) fn_call_args(f mut Fn) &Fn {
$if !js { $if !js {
fmt := p.typ_to_fmt(typ, 0) fmt := p.typ_to_fmt(typ, 0)
if fmt != '' { 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 continue
} }
} }