Subject: Teaching indent about C++ comments
To: None <tech-userlevel@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-userlevel
Date: 05/02/2006 17:34:59
--ALfTUftag+2gvp1h
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,=
=20
begin, end, if) appear in these comments. Things get real messy, and then=
=20
I have to manually fix the code. The reason for using indent is to make it=
=20
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=
=20
and '\n' at the end. The net result I had ended up stripping the "//"s out=
=20
of the text file!

Any thoughts?

Take care,

Bill

--ALfTUftag+2gvp1h
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFEV/qzWz+3JHUci9cRAnxFAJsH6zyXOUUiG9REOgCHxF8ZPY0QoQCeJinc
ADqz5yGNi3o3i0Wcnxd+UqE=
=DH10
-----END PGP SIGNATURE-----

--ALfTUftag+2gvp1h--