diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-04-26 18:07:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 18:07:25 (GMT) |
commit | f703c96cf08a0d65e718e7acfb043cbc49812a22 (patch) | |
tree | cae575ff8bf54cd1ea44867be9d20c6ff4dd035d /Lib | |
parent | 1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d (diff) | |
download | cpython-f703c96cf08a0d65e718e7acfb043cbc49812a22.zip cpython-f703c96cf08a0d65e718e7acfb043cbc49812a22.tar.gz cpython-f703c96cf08a0d65e718e7acfb043cbc49812a22.tar.bz2 |
gh-91870: Remove unsupported SRE opcode CALL (GH-91872)
It was initially added to support atomic groups, but that
support was never fully implemented, and CALL was only left
in the compiler, but not interpreter and parser.
ATOMIC_GROUP is now used to support atomic groups.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/re/_compiler.py | 6 | ||||
-rw-r--r-- | Lib/re/_constants.py | 3 | ||||
-rw-r--r-- | Lib/re/_parser.py | 4 |
3 files changed, 1 insertions, 12 deletions
diff --git a/Lib/re/_compiler.py b/Lib/re/_compiler.py index f621d04..63d8202 100644 --- a/Lib/re/_compiler.py +++ b/Lib/re/_compiler.py @@ -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: diff --git a/Lib/re/_constants.py b/Lib/re/_constants.py index aa1a590..c45ce40 100644 --- a/Lib/re/_constants.py +++ b/Lib/re/_constants.py @@ -13,7 +13,7 @@ # update when constants are added or removed -MAGIC = 20220402 +MAGIC = 20220423 from _sre import MAXREPEAT, MAXGROUPS @@ -78,7 +78,6 @@ OPCODES = _makecodes( 'ASSERT', 'ASSERT_NOT', 'AT', 'BRANCH', - 'CALL', 'CATEGORY', 'CHARSET', 'BIGCHARSET', 'GROUPREF', 'GROUPREF_EXISTS', diff --git a/Lib/re/_parser.py b/Lib/re/_parser.py index b864bf2..933d515 100644 --- a/Lib/re/_parser.py +++ b/Lib/re/_parser.py @@ -183,10 +183,6 @@ class SubPattern: 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 |