diff options
author | Miran <narimiran@disroot.org> | 2019-07-05 21:47:01 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-07-05 21:47:01 +0200 |
commit | 176eaf5c90579d76c60dcebbfea38c02a5b4d014 (patch) | |
tree | b8091268ae06490bcd72fbfdd8ea5a062774a1b4 /nimpretty/tests/expected | |
parent | d1f6c820ddc4afcfbe7b8c3fb595e9947680316a (diff) | |
download | Nim-176eaf5c90579d76c60dcebbfea38c02a5b4d014.tar.gz |
nimpretty: don't touch formatted multiline comments (#11663)
Diffstat (limited to 'nimpretty/tests/expected')
-rw-r--r-- | nimpretty/tests/expected/exhaustive.nim | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index c5ef965e6..046364f4e 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -631,10 +631,10 @@ type cmdLongOption, ## A long option such as --option cmdShortOption ## A short option such as -c OptParser* = object of RootObj ## \ - ## Implementation of the command line parser. Here is even more text yad. - ## - ## To initialize it, use the - ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + ## Implementation of the command line parser. Here is even more text yad. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. pos*: int inShortState: bool allowWhitespaceAfterColon: bool @@ -695,6 +695,34 @@ proc newRecordGen(ctx: Context; typ: TypRef): PNode = typ.recFields.map(newRecFieldGen)))) +##[ +String `interpolation`:idx: / `format`:idx: inspired by +Python's ``f``-strings. + +.. code-block:: nim + + import strformat + let msg = "hello" + doAssert fmt"{msg}\n" == "hello\\n" + +Because the literal is a raw string literal, the ``\n`` is not interpreted as +an escape sequence. + + +================= ==================================================== + Sign Meaning +================= ==================================================== +``+`` Indicates that a sign should be used for both + positive as well as negative numbers. +``-`` Indicates that a sign should be used only for + negative numbers (this is the default behavior). +(space) Indicates that a leading space should be used on + positive numbers. +================= ==================================================== + +]## + + let lla = 42394219 - 42429849 + 1293293 - 13918391 + 424242 # this here is an okayish comment llb = 42394219 - 42429849 + 1293293 - 13918391 + |