From 125ccd303ee980deda1061e346e29414658d9ae6 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 6 Oct 2017 08:20:56 +0200 Subject: [PATCH] nimpretty bugfix --- compiler/renderer.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index c0bea793d5..fba4dc9eae 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -306,7 +306,9 @@ proc ulitAux(g: TSrcGen; n: PNode, x: BiggestInt, size: int): string = proc atom(g: TSrcGen; n: PNode): string = when defined(nimpretty): - if true: + if n.info.offsetA <= n.info.offsetB: + # for some constructed tokens this can not be the case and we're better + # off to not mess with the offset then. return substr(g.origContent, n.info.offsetA, n.info.offsetB) var f: float32 case n.kind