diff options
author | Robert Bradshaw <robertwb@math.washington.edu> | 2008-11-04 12:12:00 -0800 |
---|---|---|
committer | Robert Bradshaw <robertwb@math.washington.edu> | 2008-11-04 12:12:00 -0800 |
commit | 34d912c19c64264fc86e69006e8643c4c3525b6f (patch) | |
tree | 80a600ea084f4a653a027cd03527225d84faf24f | |
parent | 2970c311196bd0a4d1287a191b6616d02054d2c3 (diff) | |
download | cython-0.10.tar.gz |
remove line comments from annotated html0.10
They're still in the source, but it makes the html less redundant and easier to read...
-rw-r--r-- | Cython/Compiler/Annotate.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Cython/Compiler/Annotate.py b/Cython/Compiler/Annotate.py index 4796ec838..09b602519 100644 --- a/Cython/Compiler/Annotate.py +++ b/Cython/Compiler/Annotate.py @@ -14,6 +14,8 @@ from Cython import Utils special_chars = [(u'<', u'\xF0', u'<'), (u'>', u'\xF1', u'>'), (u'&', u'\xF2', u'&')] + +line_pos_comment = re.compile(r'/\*.*?<<<<<<<<<<<<<<.*?\*/\n*', re.DOTALL) class AnnotationCCodeWriter(CCodeWriter): @@ -153,6 +155,7 @@ function toggleDiv(id) { f.write(line.rstrip()) f.write(u'</pre>\n') + code = re.sub(line_pos_comment, '', code) # inline annotations are redundant f.write(u"<pre id='line%s' class='code' style='background-color: #%s'>%s</pre>" % (k, color, code)) f.write(u'</body></html>\n') f.close() |