Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Lib/re/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,6 @@ def _compile(data, pattern, flags):
_compile(data, av[1], flags)
emit(SUCCESS)
code[skip] = _len(code) - skip
elif op is CALL:
emit(op)
skip = _len(code); emit(0)
_compile(data, av, flags)
emit(SUCCESS)
code[skip] = _len(code) - skip
elif op is AT:
emit(op)
if flags & SRE_FLAG_MULTILINE:
Expand Down
3 changes: 1 addition & 2 deletions Lib/re/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# update when constants are added or removed

MAGIC = 20220402
MAGIC = 20220423

from _sre import MAXREPEAT, MAXGROUPS

Expand Down Expand Up @@ -78,7 +78,6 @@ def _makecodes(*names):
'ASSERT', 'ASSERT_NOT',
'AT',
'BRANCH',
'CALL',
'CATEGORY',
'CHARSET', 'BIGCHARSET',
'GROUPREF', 'GROUPREF_EXISTS',
Expand Down
4 changes: 0 additions & 4 deletions Lib/re/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ def getwidth(self):
j = max(j, h)
lo = lo + i
hi = hi + j
elif op is CALL:
i, j = av.getwidth()
lo = lo + i
hi = hi + j
elif op is ATOMIC_GROUP:
i, j = av.getwidth()
lo = lo + i
Expand Down
73 changes: 36 additions & 37 deletions Modules/_sre/sre_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the sre.c file for information on usage and redistribution.
*/

#define SRE_MAGIC 20220402
#define SRE_MAGIC 20220423
#define SRE_OP_FAILURE 0
#define SRE_OP_SUCCESS 1
#define SRE_OP_ANY 2
Expand All @@ -20,42 +20,41 @@
#define SRE_OP_ASSERT_NOT 5
#define SRE_OP_AT 6
#define SRE_OP_BRANCH 7
#define SRE_OP_CALL 8
#define SRE_OP_CATEGORY 9
#define SRE_OP_CHARSET 10
#define SRE_OP_BIGCHARSET 11
#define SRE_OP_GROUPREF 12
#define SRE_OP_GROUPREF_EXISTS 13
#define SRE_OP_IN 14
#define SRE_OP_INFO 15
#define SRE_OP_JUMP 16
#define SRE_OP_LITERAL 17
#define SRE_OP_MARK 18
#define SRE_OP_MAX_UNTIL 19
#define SRE_OP_MIN_UNTIL 20
#define SRE_OP_NOT_LITERAL 21
#define SRE_OP_NEGATE 22
#define SRE_OP_RANGE 23
#define SRE_OP_REPEAT 24
#define SRE_OP_REPEAT_ONE 25
#define SRE_OP_SUBPATTERN 26
#define SRE_OP_MIN_REPEAT_ONE 27
#define SRE_OP_ATOMIC_GROUP 28
#define SRE_OP_POSSESSIVE_REPEAT 29
#define SRE_OP_POSSESSIVE_REPEAT_ONE 30
#define SRE_OP_GROUPREF_IGNORE 31
#define SRE_OP_IN_IGNORE 32
#define SRE_OP_LITERAL_IGNORE 33
#define SRE_OP_NOT_LITERAL_IGNORE 34
#define SRE_OP_GROUPREF_LOC_IGNORE 35
#define SRE_OP_IN_LOC_IGNORE 36
#define SRE_OP_LITERAL_LOC_IGNORE 37
#define SRE_OP_NOT_LITERAL_LOC_IGNORE 38
#define SRE_OP_GROUPREF_UNI_IGNORE 39
#define SRE_OP_IN_UNI_IGNORE 40
#define SRE_OP_LITERAL_UNI_IGNORE 41
#define SRE_OP_NOT_LITERAL_UNI_IGNORE 42
#define SRE_OP_RANGE_UNI_IGNORE 43
#define SRE_OP_CATEGORY 8
#define SRE_OP_CHARSET 9
#define SRE_OP_BIGCHARSET 10
#define SRE_OP_GROUPREF 11
#define SRE_OP_GROUPREF_EXISTS 12
#define SRE_OP_IN 13
#define SRE_OP_INFO 14
#define SRE_OP_JUMP 15
#define SRE_OP_LITERAL 16
#define SRE_OP_MARK 17
#define SRE_OP_MAX_UNTIL 18
#define SRE_OP_MIN_UNTIL 19
#define SRE_OP_NOT_LITERAL 20
#define SRE_OP_NEGATE 21
#define SRE_OP_RANGE 22
#define SRE_OP_REPEAT 23
#define SRE_OP_REPEAT_ONE 24
#define SRE_OP_SUBPATTERN 25
#define SRE_OP_MIN_REPEAT_ONE 26
#define SRE_OP_ATOMIC_GROUP 27
#define SRE_OP_POSSESSIVE_REPEAT 28
#define SRE_OP_POSSESSIVE_REPEAT_ONE 29
#define SRE_OP_GROUPREF_IGNORE 30
#define SRE_OP_IN_IGNORE 31
#define SRE_OP_LITERAL_IGNORE 32
#define SRE_OP_NOT_LITERAL_IGNORE 33
#define SRE_OP_GROUPREF_LOC_IGNORE 34
#define SRE_OP_IN_LOC_IGNORE 35
#define SRE_OP_LITERAL_LOC_IGNORE 36
#define SRE_OP_NOT_LITERAL_LOC_IGNORE 37
#define SRE_OP_GROUPREF_UNI_IGNORE 38
#define SRE_OP_IN_UNI_IGNORE 39
#define SRE_OP_LITERAL_UNI_IGNORE 40
#define SRE_OP_NOT_LITERAL_UNI_IGNORE 41
#define SRE_OP_RANGE_UNI_IGNORE 42
#define SRE_AT_BEGINNING 0
#define SRE_AT_BEGINNING_LINE 1
#define SRE_AT_BEGINNING_STRING 2
Expand Down
1 change: 0 additions & 1 deletion Modules/_sre/sre_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,6 @@ SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel)
TARGET(SRE_OP_NEGATE):
TARGET(SRE_OP_BIGCHARSET):
TARGET(SRE_OP_CHARSET):
TARGET(SRE_OP_CALL):
TRACE(("|%p|%p|UNKNOWN %d\n", pattern, ptr,
pattern[-1]));
RETURN_ERROR(SRE_ERROR_ILLEGAL);
Expand Down
3 changes: 1 addition & 2 deletions Modules/_sre/sre_targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the sre.c file for information on usage and redistribution.
*/

static void *sre_targets[44] = {
static void *sre_targets[43] = {
&&TARGET_SRE_OP_FAILURE,
&&TARGET_SRE_OP_SUCCESS,
&&TARGET_SRE_OP_ANY,
Expand All @@ -20,7 +20,6 @@ static void *sre_targets[44] = {
&&TARGET_SRE_OP_ASSERT_NOT,
&&TARGET_SRE_OP_AT,
&&TARGET_SRE_OP_BRANCH,
&&TARGET_SRE_OP_CALL,
&&TARGET_SRE_OP_CATEGORY,
&&TARGET_SRE_OP_CHARSET,
&&TARGET_SRE_OP_BIGCHARSET,
Expand Down