[svn r38370] 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 \. --HG-- branch : trunk
This commit is contained in:
parent
4d4ce90f73
commit
663447a7d1
|
@ -67,15 +67,15 @@ class Tokenizer(object):
|
|||
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)))
|
||||
if schema.linejoin:
|
||||
j = schema.linejoin
|
||||
for d in schema.string + schema.multiline_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,))))
|
||||
if schema.linejoin:
|
||||
j = schema.linejoin
|
||||
for d in schema.string:
|
||||
self._re_strings_multiline.append(
|
||||
(re.compile('%s.*%s$' % (d, j)),
|
||||
re.compile('.*?%s' % (d,))))
|
||||
# no multi-line comments in Python... phew :)
|
||||
self._re_comments = []
|
||||
for start, end in schema.comment:
|
||||
|
@ -119,7 +119,6 @@ class Tokenizer(object):
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue