mirror of
https://github.com/python/cpython.git
synced 2025-07-29 22:24:49 +00:00
In the experimental 'Scanner' feature, the group count was set wrong.
This commit is contained in:
parent
727a59070d
commit
212861c54f
1 changed files with 1 additions and 1 deletions
|
@ -300,8 +300,8 @@ class Scanner:
|
||||||
p.append(sre_parse.SubPattern(s, [
|
p.append(sre_parse.SubPattern(s, [
|
||||||
(SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))),
|
(SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))),
|
||||||
]))
|
]))
|
||||||
|
s.groups = len(p)+1
|
||||||
p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])
|
p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])
|
||||||
s.groups = len(p)
|
|
||||||
self.scanner = sre_compile.compile(p)
|
self.scanner = sre_compile.compile(p)
|
||||||
def scan(self, string):
|
def scan(self, string):
|
||||||
result = []
|
result = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue