Both the re and pegs module's =~ templates can now be used simultaneously from the same module.

This commit is contained in:
Dominik Picheta
2012-07-21 11:21:41 +01:00
parent 34efc2cdf9
commit b839e42e92
2 changed files with 2 additions and 2 deletions

View File

@@ -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 ------------------------------

View File

@@ -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 ------------------------------