Ma Lin <malin...@163.com> added the comment:
My PR methods are suboptimal, so I closed them. The number of REPEAT can be counted when compiling a pattern, and allocate a `SRE_REPEAT` array in `SRE_STATE` (with that number items). It seem at any time, a REPEAT will only have one in active, so a `SRE_REPEAT` array is fine. regex module does like this: https://github.com/mrabarnett/mrab-regex/blob/hg/regex_3/_regex.c#L18287-L18288 Can the number of REPEAT be placed in `SRE_OP_INFO`? And add a field to `SRE_OP_REPEAT` to indicate the index of this REPEAT. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue23689> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com