summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ast.nim3
-rw-r--r--lib/system.nim3
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 36d29e06a..668f20bcd 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -948,6 +948,9 @@ proc add*(father, son: PNode) =
 proc `[]`*(n: PNode, i: int): PNode {.inline.} =
   result = n.sons[i]
 
+template `-|`*(b, s: expr): expr =
+  (if b >= 0: b else: s.len + b)
+
 # son access operators with support for negative indices
 template `{}`*(n: PNode, i: int): expr = n[i -| n]
 template `{}=`*(n: PNode, i: int, s: PNode): stmt =
diff --git a/lib/system.nim b/lib/system.nim
index 90587f306..949443dd9 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2859,9 +2859,6 @@ proc `/`*(x, y: int): float {.inline, noSideEffect.} =
   ## integer division that results in a float.
   result = toFloat(x) / toFloat(y)
 
-template `-|`*(b, s: expr): expr =
-  (if b >= 0: b else: s.len + b)
-
 template spliceImpl(s, a, L, b: expr): stmt {.immediate.} =
   # make room for additional elements or cut:
   var slen = s.len