summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorChris Heller <chris.heller@greyheller.com>2015-03-03 09:22:54 -0800
committerChris Heller <chris.heller@greyheller.com>2015-03-03 09:22:54 -0800
commitb54dfbce1664a6f0c9deb845d94ce173e5e0831d (patch)
treec9c8aca6a3636dc7506393bf0778573381f1a298 /lib
parentdf7e388e0c226731be3c46be7aad2d9993599a9e (diff)
downloadNim-b54dfbce1664a6f0c9deb845d94ce173e5e0831d.tar.gz
Remove use of .format() from macros.nim to avoid importing into core. There is still a remaining import of cmpIgnoreStyle from strutils that needs to be removed as well
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 519bae209..19c10fb93 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -339,13 +339,13 @@ proc quote*(bl: stmt, op = "``"): PNimrodNode {.magic: "QuoteAst", noSideEffect.
   ##       if not `ex`:
   ##         echo `info` & ": Check failed: " & `expString`
 
-from strutils import cmpIgnoreStyle, format
+from strutils import cmpIgnoreStyle
 
 proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} =
   ## checks that `n` is of kind `k`. If this is not the case,
   ## compilation aborts with an error message. This is useful for writing
   ## macros that check the AST that is passed to them.
-  if n.kind != k: error("Expected a node of kind $1, got $2".format(k, n.kind))
+  if n.kind != k: error("Expected a node of kind " & $k & ", got " & $n.kind)
 
 proc expectMinLen*(n: PNimrodNode, min: int) {.compileTime.} =
   ## checks that `n` has at least `min` children. If this is not the case,
@@ -584,7 +584,7 @@ const
     nnkCallStrLit, nnkHiddenCallConv}
 
 proc expectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} =
-  assert n.kind in k, "Expected one of $1, got $2".format(k, n.kind)
+  assert n.kind in k, "Expected one of " & $k & ", got " & $n.kind
 
 proc newProc*(name = newEmptyNode(); params: openArray[PNimrodNode] = [newEmptyNode()];
     body: PNimrodNode = newStmtList(), procType = nnkProcDef): PNimrodNode {.compileTime.} =
@@ -654,7 +654,7 @@ proc `pragma=`*(someProc: PNimrodNode; val: PNimrodNode){.compileTime.}=
 
 
 template badNodeKind(k; f): stmt{.immediate.} =
-  assert false, "Invalid node kind $# for macros.`$2`".format(k, f)
+  assert false, "Invalid node kind " & $k & " for macros.`" & $f & "`"
 
 proc body*(someProc: PNimrodNode): PNimrodNode {.compileTime.} =
   case someProc.kind: