Skip to content

Commit

Permalink
nimpretty: fixes #9144
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored and narimiran committed Nov 1, 2018
1 parent d0718e2 commit f240d92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/layouter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions nimpretty/tests/expected/simple.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

var x: int = 2

echo x # bug #9144
5 changes: 5 additions & 0 deletions nimpretty/tests/simple.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

var x: int = 2

echo x
# bug #9144

0 comments on commit f240d92

Please sign in to comment.