summary refs log tree commit diff stats
path: root/lib/pure/strformat.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-06 20:56:48 +0200
committerAraq <rumpf_a@web.de>2019-04-06 20:56:48 +0200
commitf6ad071a46a2bec57db453343d8d8b75d3d16ac2 (patch)
treedb507325c8946eb48b2768dc4d89f2c4e8833462 /lib/pure/strformat.nim
parent9f5d9d19937a321cb7a9cec06a0a14ea07627f3d (diff)
downloadNim-f6ad071a46a2bec57db453343d8d8b75d3d16ac2.tar.gz
make strformat work as NimScript again
Diffstat (limited to 'lib/pure/strformat.nim')
-rw-r--r--lib/pure/strformat.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim
index c561f5085..1132e6dc7 100644
--- a/lib/pure/strformat.nim
+++ b/lib/pure/strformat.nim
@@ -513,8 +513,11 @@ macro `&`*(pattern: string): untyped =
         try:
           x = parseExpr(subexpr)
         except ValueError:
-          let msg = getCurrentExceptionMsg()
-          error("could not parse ``" & subexpr & "``.\n" & msg, pattern)
+          when declared(getCurrentExceptionMsg):
+            let msg = getCurrentExceptionMsg()
+            error("could not parse `" & subexpr & "`.\n" & msg, pattern)
+          else:
+            error("could not parse `" & subexpr & "`.\n", pattern)
         let formatSym = bindSym("formatValue", brOpen)
         var options = ""
         if f[i] == ':':