diff options
author | Miran <narimiran@disroot.org> | 2019-07-05 09:32:56 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-07-05 09:32:56 +0200 |
commit | 96a19ea1b441f5e1682b2f04bac188003ceea6dd (patch) | |
tree | a119e332eb484cee39495cbca9f92f19ad4c3e80 /nimpretty/tests/expected | |
parent | 95f2f2396f868b418996358d6328368395a1f5c6 (diff) | |
download | Nim-96a19ea1b441f5e1682b2f04bac188003ceea6dd.tar.gz |
nimpretty: relax line length rules when dealing with (inline) comments (#11657)
Diffstat (limited to 'nimpretty/tests/expected')
-rw-r--r-- | nimpretty/tests/expected/exhaustive.nim | 19 | ||||
-rw-r--r-- | nimpretty/tests/expected/simple3.nim | 3 |
2 files changed, 17 insertions, 5 deletions
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index 4ed056656..c5ef965e6 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -19,8 +19,7 @@ var body = newNimNode(nnkIfExpr).add( ident("kind"))), condition ), - newNimNode(nnkElse).add(newStmtList(newNimNode(nnkReturnStmt).add(ident( - "false")))) + newNimNode(nnkElse).add(newStmtList(newNimNode(nnkReturnStmt).add(ident("false")))) ) # comment @@ -122,7 +121,7 @@ type inquote {.pragmaHereWrongCurlyEnd.}: bool col, lastLineNumber, lineSpan, indentLevel: int content: string - fixedUntil: int # marks where we must not go in the content + fixedUntil: int # marks where we must not go in the content altSplitPos: array[SplitKind, int] # alternative split positions proc openEmitter*[T, S](em: var Emitter; config: ConfigRef; @@ -695,3 +694,17 @@ proc newRecordGen(ctx: Context; typ: TypRef): PNode = nkRecList.t( typ.recFields.map(newRecFieldGen)))) + +let + lla = 42394219 - 42429849 + 1293293 - 13918391 + 424242 # this here is an okayish comment + llb = 42394219 - 42429849 + 1293293 - 13918391 + + 424242 # this here is a very long comment which should be split + llc = 42394219 - 42429849 + 1293293 - 13918391 + 424242 - 3429424 + 4239489 - 42399 + lld = 42394219 - 42429849 + 1293293 - 13918391 + 424242 - 342949924 + + 423948999 - 42399 + +type + MyLongEnum = enum ## doc comment here + first, ## this is a long comment here, but please align it + secondWithAVeryLongNameMightBreak, ## this is a short one + thirdOne ## it's ok diff --git a/nimpretty/tests/expected/simple3.nim b/nimpretty/tests/expected/simple3.nim index b7a02758a..c1c0af449 100644 --- a/nimpretty/tests/expected/simple3.nim +++ b/nimpretty/tests/expected/simple3.nim @@ -9,8 +9,7 @@ proc fun() = echo "ok1" proc fun2(a = "fooo" & "bar" & "bar" & "bar" & "bar" & ("bar" & "bar" & "bar") & - "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & - "bar"): auto = + "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar"): auto = discard fun2() |