From 778e4d1775be16732cff396c9db4701d96d4e753 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 16 Oct 2018 17:21:41 +0200 Subject: [PATCH] nimpretty: fixes #9144 --- compiler/layouter.nim | 1 + nimpretty/tests/expected/simple.nim | 4 ++++ nimpretty/tests/simple.nim | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 nimpretty/tests/expected/simple.nim create mode 100644 nimpretty/tests/simple.nim diff --git a/compiler/layouter.nim b/compiler/layouter.nim index 560e8eec75..9ddfbeabcd 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -52,6 +52,7 @@ proc openEmitter*(em: var Emitter, cache: IdentCache; em.content = newStringOfCap(16_000) em.indentStack = newSeqOfCap[int](30) em.indentStack.add 0 + em.lastLineNumber = 1 proc closeEmitter*(em: var Emitter) = var f = llStreamOpen(em.config.outFile, fmWrite) diff --git a/nimpretty/tests/expected/simple.nim b/nimpretty/tests/expected/simple.nim new file mode 100644 index 0000000000..75f570bac1 --- /dev/null +++ b/nimpretty/tests/expected/simple.nim @@ -0,0 +1,4 @@ + +var x: int = 2 + +echo x # bug #9144 diff --git a/nimpretty/tests/simple.nim b/nimpretty/tests/simple.nim new file mode 100644 index 0000000000..9e3c52f9bd --- /dev/null +++ b/nimpretty/tests/simple.nim @@ -0,0 +1,5 @@ + +var x: int = 2 + +echo x +# bug #9144