Both the re and pegs module's =~ templates can now be used simultaneously from the same module.
This commit is contained in:
parent
34efc2cdf9
commit
b839e42e92
2 changed files with 2 additions and 2 deletions
|
|
@ -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 ------------------------------
|
||||
|
|
|
|||
|
|
@ -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 ------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue