aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-11-24 12:02:57 +0000
committerArmin Rigo <arigo@tunes.org>2020-11-24 12:02:57 +0000
commit9eba2b4f9d910de5b1d542c77474406ba0ba0335 (patch)
tree6f2b0727b9ba54fc02f0ca1b371e9c3340d7337d /rpython
parentback-port the rpython bits of "py3.7-rsre" (diff)
downloadpypy-9eba2b4f9d910de5b1d542c77474406ba0ba0335.tar.gz
pypy-9eba2b4f9d910de5b1d542c77474406ba0ba0335.tar.bz2
pypy-9eba2b4f9d910de5b1d542c77474406ba0ba0335.zip
fixes
Diffstat (limited to 'rpython')
-rw-r--r--rpython/rlib/rsre/rsre_utf8.py5
-rw-r--r--rpython/rlib/rsre/test/support.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/rpython/rlib/rsre/rsre_utf8.py b/rpython/rlib/rsre/rsre_utf8.py
index aaac302ac0..7617acc5fd 100644
--- a/rpython/rlib/rsre/rsre_utf8.py
+++ b/rpython/rlib/rsre/rsre_utf8.py
@@ -93,10 +93,11 @@ def utf8match(pattern, utf8string, bytestart=0, byteend=sys.maxint,
fullmatch=False):
# bytestart and byteend must be valid byte positions inside the
# utf8string.
- from rpython.rlib.rsre.rsre_core import match_context
+ from rpython.rlib.rsre.rsre_core import match_context, MODE_FULL
ctx = make_utf8_ctx(utf8string, bytestart, byteend)
- ctx.fullmatch_only = fullmatch
+ if fullmatch:
+ ctx.match_mode = MODE_FULL
if match_context(ctx, pattern):
return ctx
else:
diff --git a/rpython/rlib/rsre/test/support.py b/rpython/rlib/rsre/test/support.py
index 9e8fafc7c1..4e12277bcb 100644
--- a/rpython/rlib/rsre/test/support.py
+++ b/rpython/rlib/rsre/test/support.py
@@ -1,6 +1,7 @@
import sys, random
from rpython.rlib import debug
from rpython.rlib.rsre.rsre_core import _adjust, match_context, search_context
+from rpython.rlib.rsre.rsre_core import MODE_FULL
from rpython.rlib.rsre.rsre_core import StrMatchContext, EndOfString
@@ -112,7 +113,8 @@ def match(pattern, string, start=0, end=sys.maxint, fullmatch=False):
start = Position(start)
end = Position(end)
ctx = MatchContextForTests(string, start, end)
- ctx.fullmatch_only = fullmatch
+ if fullmatch:
+ ctx.match_mode = MODE_FULL
if match_context(ctx, pattern):
return ctx
else: