summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2012-07-21 11:21:41 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2012-07-21 11:21:41 +0100
commitb839e42e92edf6acfca73768cbdd9c7595ca8797 (patch)
tree1b8ae562a2a48802f5c4ce1dd372ab937e69b921
parent34efc2cdf9ac515fae55ec2cc9d6efac37f63398 (diff)
downloadNim-b839e42e92edf6acfca73768cbdd9c7595ca8797.tar.gz
Both the re and pegs module's `=~` templates can now be used simultaneously from the same module.
-rwxr-xr-xlib/impure/re.nim2
-rwxr-xr-xlib/pure/pegs.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim
index ebc4c549a..7ef3d247a 100755
--- a/lib/impure/re.nim
+++ b/lib/impure/re.nim
@@ -237,7 +237,7 @@ template `=~` *(s: string, pattern: TRegEx): expr =
   ##     echo("syntax error")
   ##
   when not definedInScope(matches):
-    var matches: array[0..maxSubPatterns-1, string]
+    var matches: array[0..re.maxSubPatterns-1, string]
   match(s, pattern, matches)
 
 # ------------------------- more string handling ------------------------------
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim
index 0a7c95a70..ff88c56b8 100755
--- a/lib/pure/pegs.nim
+++ b/lib/pure/pegs.nim
@@ -865,7 +865,7 @@ template `=~`*(s: string, pattern: TPeg): bool =
   ##     echo("syntax error")
   ##  
   when not definedInScope(matches):
-    var matches: array[0..maxSubpatterns-1, string]
+    var matches: array[0..pegs.maxSubpatterns-1, string]
   match(s, pattern, matches)
 
 # ------------------------- more string handling ------------------------------