summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-08-01 21:05:41 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-08-01 21:05:41 (GMT)
commit2f2c67d7e5934bdf96835f3c4774388b3e654314 (patch)
tree1d573a6163fe77af982c4637f809b1e468873a74 /Lib/sre_compile.py
parent329e29198dccbbb7f0e7e84c026196dbfc47befa (diff)
downloadcpython-2f2c67d7e5934bdf96835f3c4774388b3e654314.zip
cpython-2f2c67d7e5934bdf96835f3c4774388b3e654314.tar.gz
cpython-2f2c67d7e5934bdf96835f3c4774388b3e654314.tar.bz2
-- fixed width calculations for alternations
-- fixed literal check in branch operator (this broke test_tokenize, as reported by Mark Favas) -- added REPEAT_ONE operator (still not enabled, though) -- added some debugging stuff (maxlevel)
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 2d1cbb1..8fdcecf 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -270,6 +270,7 @@ def _compile_info(code, pattern, flags):
table[i+1] = table[table[i+1]-1]+1
code.extend(table[1:]) # don't store first entry
elif charset:
+ # FIXME: use charset optimizer!
for char in charset:
emit(OPCODES[LITERAL])
emit(char)
@@ -283,7 +284,7 @@ try:
except NameError:
pass
-def _compile1(p, flags):
+def _code(p, flags):
flags = p.pattern.flags | flags
code = []
@@ -308,7 +309,7 @@ def compile(p, flags=0):
else:
pattern = None
- code = _compile1(p, flags)
+ code = _code(p, flags)
# print code