summary refs log tree commit diff stats
path: root/lib/impure
diff options
context:
space:
mode:
Diffstat (limited to 'lib/impure')
-rw-r--r--lib/impure/re.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim
index 57dc3a313..ef02a3b1d 100644
--- a/lib/impure/re.nim
+++ b/lib/impure/re.nim
@@ -239,8 +239,9 @@ template `=~` *(s: string, pattern: TRegEx): expr =
   ##   else:
   ##     echo("syntax error")
   ##
+  bind maxSubPatterns
   when not definedInScope(matches):
-    var matches {.inject.}: array[0..re.maxSubPatterns-1, string]
+    var matches {.inject.}: array[0..maxSubPatterns-1, string]
   match(s, pattern, matches)
 
 # ------------------------- more string handling ------------------------------