diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 47083216aa..877369c2a5 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -1144,6 +1144,7 @@ proc skip(L: var TLexer, tok: var TToken) = hasComment = true if tok.line < 0: tok.line = L.lineNumber + commentIndent = indent skipMultiLineComment(L, tok, pos+2, false) pos = L.bufpos buf = L.buf diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim index c02f69668c..9202de703d 100644 --- a/nimpretty/tests/exhaustive.nim +++ b/nimpretty/tests/exhaustive.nim @@ -334,3 +334,26 @@ proc abcdef*[T:not (tuple|object|string|cstring|char|ref|ptr|array|seq|distinct) # bug #9504 type T2 = a.type discard + +proc fun() = + #[ + this one here + ]# + discard + +proc fun2() = + ##[ + foobar + ]## + discard + +#[ +foobar +]# + +proc fun3() = + discard + +##[ +foobar +]## diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index 03c4eb929f..6d000d524e 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -343,3 +343,26 @@ proc abcdef*[T: not (tuple|object|string|cstring|char|ref|ptr|array|seq|distinct # bug #9504 type T2 = a.type discard + +proc fun() = + #[ + this one here + ]# + discard + +proc fun2() = + ##[ + foobar + ]## + discard + +#[ +foobar +]# + +proc fun3() = + discard + +##[ +foobar +]##