[py-svn] r38370 - py/trunk/py/apigen/source
guido at codespeak.net
guido at codespeak.net
Sat Feb 10 13:02:07 CET 2007
Author: guido
Date: Sat Feb 10 13:02:06 2007
New Revision: 38370
Modified:
py/trunk/py/apigen/source/color.py
Log:
Hrmph, probably the nastiest case of 'debug print' I ran into so far, bringing
apigen almost to a crawl... Also small optimization making that 'normal'
multi-line strings are resolved before those using \.
Modified: py/trunk/py/apigen/source/color.py
==============================================================================
--- py/trunk/py/apigen/source/color.py (original)
+++ py/trunk/py/apigen/source/color.py Sat Feb 10 13:02:06 2007
@@ -67,15 +67,15 @@
self._re_strings_full.append(
re.compile(r'%s[^\\%s]+(\\.[^\\%s]*)*%s' % (d, d, d, d)))
self._re_strings_empty.append(re.compile('%s%s' % (d, d)))
+ for d in schema.multiline_string:
+ self._re_strings_multiline.append((re.compile('%s.*' % (d,), re.S),
+ re.compile('.*?%s' % (d,))))
if schema.linejoin:
j = schema.linejoin
- for d in schema.string + schema.multiline_string:
+ for d in schema.string:
self._re_strings_multiline.append(
(re.compile('%s.*%s$' % (d, j)),
re.compile('.*?%s' % (d,))))
- for d in schema.multiline_string:
- self._re_strings_multiline.append((re.compile('%s.*' % (d,), re.S),
- re.compile('.*?%s' % (d,))))
# no multi-line comments in Python... phew :)
self._re_comments = []
for start, end in schema.comment:
@@ -119,7 +119,6 @@
def _check_multiline_strings(self, data):
token = None
for start, end in self._re_strings_multiline:
- print dir(start), end
m = start.match(data)
if m:
s = m.group(0)
More information about the pytest-commit
mailing list