diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-07 20:59:04 +0000 |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-08-07 20:59:04 +0000 |
commit | 2be0a3e756db42c44a34b78018e3aa47f2815bc2 (patch) | |
tree | a13ee6e174e9f32ca94428d660a8755cb33f4c18 /Lib/sre_parse.py | |
parent | d1e745eca9c2c6a6422c6393002eb09a37b8a6c4 (diff) | |
download | cpython-2be0a3e756db42c44a34b78018e3aa47f2815bc2.tar.gz |
-- 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 1c1d0d5d44..16e49b620e 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) |