diff -r bedef1c228d3 -r 62b8f15683f2 contrib/check-code.py --- a/contrib/check-code.py Thu Mar 18 01:59:53 2010 +0100 +++ b/contrib/check-code.py Thu Mar 18 16:32:03 2010 +0100 @@ -14,6 +14,12 @@ t = re.sub(r"[^\sx]", "o", t) return m.group('quote') + t + m.group('quote') +def reppython(m): + comment = m.group('comment') + if comment: + return "#" * len(comment) + return repquote(m) + def repcomment(m): return m.group(1) + "#" * len(m.group(2)) @@ -96,10 +102,10 @@ ] pyfilters = [ - (r"""(?msx)(?P('''|\"\"\"|(?(.*?)) - (?\#.*?$)| + ((?P('''|\"\"\"|(?(([^\\]|\\.)*?)) + (?P=quote))""", reppython), ] cpats = [