[Pyrex] Better comment lines in C source?

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Aug 26 03:41:24 CEST 2004


"Edward K. Ream" <edreamleo at charter.net>:

> C listings are commented by line number:
> 
> /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":9 */
> 
> The pyrex source might be more informative:
> 
> /* while k < kmax: */

Those comments are mostly there for my benefit when I'm debugging the
compiler. They're easy to produce because every parse tree node has
information about the source file position. Including the actual
source would require considerably more work. It could also be a bit
tricky, because the source statement giving rise to a particular block
of C code could be spread over several lines.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list