comment style

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Tue Jan 8 15:24:46 AEST 1991


In article <1640 at inews.intel.com> bhoughto at hopi.intel.com (Blair P. Houghton) writes:
> Likewise.  TeX ignores newlines, unless you tell it not to,
> as for example by placing a comment there, which it then ignores.

No, TeX doesn't ignore newlines. Sorry I didn't explain this well enough
the first time. Here's a complete parser for TeX's end-of-line % comment
mechanism: When you see %, read and throw away characters until newline.
Throw away the newline as well. Continue.

For a programming language it's probably better to replace the newline
with a space than to concatenate the lines around it, for the same
reason that /*foo*/ becomes a space in (non-cpp) C. But the point is
that this mechanism handles both comments and continuations in one fell
swoop.

---Dan



More information about the Comp.std.c mailing list