Subject: Teaching indent about C++ comments
To: None <>
From: Bill Studenmund <>
List: tech-userlevel
Date: 05/02/2006 17:34:59
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

So I have some C code that has C++ comments in it ( ...  // comment  )
and I'm trying to use our indent to reformat it.

Our indent is the original one, and doesn't understand them. It thinks=20
they are two division symbols. The big problem is when valid C tokens (do,=
begin, end, if) appear in these comments. Things get real messy, and then=
I have to manually fix the code. The reason for using indent is to make it=
automatic. :-)

So I tried to change indent to handle this. I failed.

I tried to mimic the current comment handling, but using "//" as the start=
and '\n' at the end. The net result I had ended up stripping the "//"s out=
of the text file!

Any thoughts?

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)