de-deprecate re.nim

This commit is contained in:
Andreas Rumpf 2016-06-13 12:05:21 +02:00
commit 112cde69c8

View file

@ -7,8 +7,11 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
## Regular expression support for Nim. Deprecated. Consider using the ``nre`` ## Regular expression support for Nim. This module still has some
## or ``pegs`` modules instead. ## obscure bugs and limitations,
## consider using the ``nre`` or ``pegs`` modules instead.
## We had to de-deprecate this module since too much code relies on it
## and many people prefer its API over ``nre``'s.
## ##
## **Note:** The 're' proc defaults to the **extended regular expression ## **Note:** The 're' proc defaults to the **extended regular expression
## syntax** which lets you use whitespace freely to make your regexes readable. ## syntax** which lets you use whitespace freely to make your regexes readable.
@ -28,8 +31,6 @@
import import
pcre, strutils, rtarrays pcre, strutils, rtarrays
{.deprecated.}
const const
MaxSubpatterns* = 20 MaxSubpatterns* = 20
## defines the maximum number of subpatterns that can be captured. ## defines the maximum number of subpatterns that can be captured.
@ -78,7 +79,7 @@ proc finalizeRegEx(x: Regex) =
if not isNil(x.e): if not isNil(x.e):
pcre.free_substring(cast[cstring](x.e)) pcre.free_substring(cast[cstring](x.e))
proc re*(s: string, flags = {reExtended, reStudy}): Regex {.deprecated.} = proc re*(s: string, flags = {reExtended, reStudy}): Regex =
## Constructor of regular expressions. Note that Nim's ## Constructor of regular expressions. Note that Nim's
## extended raw string literals support this syntax ``re"[abc]"`` as ## extended raw string literals support this syntax ``re"[abc]"`` as
## a short form for ``re(r"[abc]")``. ## a short form for ``re(r"[abc]")``.