diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-07 20:59:04 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-07 20:59:04 (GMT) |
commit | 7898c3e6852565046a9b8b063d35d66777bf5176 (patch) | |
tree | e4846002d94c6f96d180cde05a6ccac095287de6 /Lib/sre_parse.py | |
parent | 6947d0b65eb21606de8e17b180bf116421d23116 (diff) | |
download | cpython-7898c3e6852565046a9b8b063d35d66777bf5176.zip cpython-7898c3e6852565046a9b8b063d35d66777bf5176.tar.gz cpython-7898c3e6852565046a9b8b063d35d66777bf5176.tar.bz2 |
-- reset marks if repeat_one tail doesn't match
(this should fix Sjoerd's xmllib problem)
-- added skip field to INFO header
-- changed compiler to generate charset INFO header
-- changed trace messages to support post-mortem analysis
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 1c1d0d5..16e49b6 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -10,8 +10,6 @@ import string, sys -import _sre - from sre_constants import * MAXREPEAT = 65535 @@ -232,6 +230,7 @@ def _class_escape(source, escape): return code try: if escape[1:2] == "x": + # FIXME: in 2.0, \xNN must have exactly two digits while source.next in HEXDIGITS: escape = escape + source.get() escape = escape[2:] @@ -556,12 +555,13 @@ def _parse(source, state): return subpattern -def parse(str, flags=0): +def parse(str, flags=0, pattern=None): # parse 're' pattern into list of (opcode, argument) tuples source = Tokenizer(str) - pattern = Pattern() + if pattern is None: + pattern = Pattern() pattern.flags = flags p = _parse_sub(source, pattern, 0) |