mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
- fixed grouping error bug
- changed "group" operator to "groupref"
This commit is contained in:
parent
6f01398236
commit
72b82ba16d
6 changed files with 55 additions and 31 deletions
|
@ -241,7 +241,7 @@ def _escape(source, escape, state):
|
|||
if group:
|
||||
if (not source.next or
|
||||
not _group(escape + source.next, state.groups)):
|
||||
return GROUP, group
|
||||
return GROUPREF, group
|
||||
escape = escape + source.get()
|
||||
elif source.next in OCTDIGITS:
|
||||
escape = escape + source.get()
|
||||
|
@ -450,7 +450,7 @@ def _parse(source, state):
|
|||
gid = state.groupdict.get(name)
|
||||
if gid is None:
|
||||
raise error, "unknown group name"
|
||||
subpattern.append((GROUP, gid))
|
||||
subpattern.append((GROUPREF, gid))
|
||||
elif source.match("#"):
|
||||
index = ""
|
||||
while 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue