Issue #433028: Added support of modifier spans in regular expressions.

This commit is contained in:
Serhiy Storchaka 2016-09-10 00:57:55 +03:00
parent ee73a65745
commit be9a4e5c85
7 changed files with 180 additions and 66 deletions

View file

@ -352,7 +352,7 @@ class Scanner:
for phrase, action in lexicon:
gid = s.opengroup()
p.append(sre_parse.SubPattern(s, [
(SUBPATTERN, (gid, sre_parse.parse(phrase, flags))),
(SUBPATTERN, (gid, 0, 0, sre_parse.parse(phrase, flags))),
]))
s.closegroup(gid, p[-1])
p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])