mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
Added new opcode RANGE_IGNORE.
This commit is contained in:
parent
455de40a6e
commit
4b8f8949b4
8 changed files with 99 additions and 28 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
# update when constants are added or removed
|
||||
|
||||
MAGIC = 20031017
|
||||
MAGIC = 20140917
|
||||
|
||||
from _sre import MAXREPEAT, MAXGROUPS
|
||||
|
||||
|
@ -56,6 +56,7 @@ NEGATE = "negate"
|
|||
NOT_LITERAL = "not_literal"
|
||||
NOT_LITERAL_IGNORE = "not_literal_ignore"
|
||||
RANGE = "range"
|
||||
RANGE_IGNORE = "range_ignore"
|
||||
REPEAT = "repeat"
|
||||
REPEAT_ONE = "repeat_one"
|
||||
SUBPATTERN = "subpattern"
|
||||
|
@ -121,7 +122,8 @@ OPCODES = [
|
|||
REPEAT,
|
||||
REPEAT_ONE,
|
||||
SUBPATTERN,
|
||||
MIN_REPEAT_ONE
|
||||
MIN_REPEAT_ONE,
|
||||
RANGE_IGNORE,
|
||||
|
||||
]
|
||||
|
||||
|
@ -159,7 +161,8 @@ OP_IGNORE = {
|
|||
GROUPREF: GROUPREF_IGNORE,
|
||||
IN: IN_IGNORE,
|
||||
LITERAL: LITERAL_IGNORE,
|
||||
NOT_LITERAL: NOT_LITERAL_IGNORE
|
||||
NOT_LITERAL: NOT_LITERAL_IGNORE,
|
||||
RANGE: RANGE_IGNORE,
|
||||
}
|
||||
|
||||
AT_MULTILINE = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue