pegs/re =~ warns about scope rule change; improved docs

This commit is contained in:
Araq 2013-05-08 15:49:04 +02:00
commit 44c4b945eb
4 changed files with 19 additions and 9 deletions

View file

@ -242,6 +242,7 @@ template `=~` *(s: string, pattern: TRegEx): expr =
bind maxSubPatterns
when not definedInScope(matches):
var matches {.inject.}: array[0..maxSubPatterns-1, string]
{.warning: "injected 'matches' might be affected by new scoping rules in 0.9.4".}
match(s, pattern, matches)
# ------------------------- more string handling ------------------------------