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
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") ## echo("syntax error")
## ##
when not definedInScope(matches): when not definedInScope(matches):
var matches: array[0..maxSubPatterns-1, string] var matches: array[0..re.maxSubPatterns-1, string]
match(s, pattern, matches) match(s, pattern, matches)
# ------------------------- more string handling ------------------------------ # ------------------------- more string handling ------------------------------

View file

@ -865,7 +865,7 @@ template `=~`*(s: string, pattern: TPeg): bool =
## echo("syntax error") ## echo("syntax error")
## ##
when not definedInScope(matches): when not definedInScope(matches):
var matches: array[0..maxSubpatterns-1, string] var matches: array[0..pegs.maxSubpatterns-1, string]
match(s, pattern, matches) match(s, pattern, matches)
# ------------------------- more string handling ------------------------------ # ------------------------- more string handling ------------------------------