From b4bf12378ebb0b6ad33fcbbadb68277e980973e9 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Tue, 8 Oct 2019 17:52:11 +1100 Subject: [PATCH] fix newline being added when using print with int --- compiler/fn.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/fn.v b/compiler/fn.v index 136f2bdc12..c7957ecd28 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -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 } }