diff options
author | Oscar Nihlgård <oscarnihlgard@gmail.com> | 2018-01-09 00:18:32 +0100 |
---|---|---|
committer | Oscar Nihlgård <oscarnihlgard@gmail.com> | 2018-01-09 00:18:32 +0100 |
commit | cde3a4f586f5d22bd7acc8849543821a1830008f (patch) | |
tree | 569b39268330b0e09f7d51eab4a8a5e2386fbb01 /lib/pure/strformat.nim | |
parent | 424532f883305454899b2bdb9c42874b4f0cbcda (diff) | |
download | Nim-cde3a4f586f5d22bd7acc8849543821a1830008f.tar.gz |
Add additional $ fallback to fmt
Diffstat (limited to 'lib/pure/strformat.nim')
-rw-r--r-- | lib/pure/strformat.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim index e04c80794..d1dedb625 100644 --- a/lib/pure/strformat.nim +++ b/lib/pure/strformat.nim @@ -221,8 +221,10 @@ template callFormat(res, arg) {.dirty.} = template callFormatOption(res, arg, option) {.dirty.} = when compiles(format(arg, option, res)): format(arg, option, res) - else: + elif compiles(format(arg, option)): res.add format(arg, option) + else: + format($arg, option, res) macro fmt*(pattern: string{lit}): untyped = ## For a specification of the ``fmt`` macro, see the module level documentation. |