mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
Both the re and pegs module's =~ templates can now be used simultaneously from the same module.
This commit is contained in:
@@ -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 ------------------------------
|
||||
|
||||
Reference in New Issue
Block a user