comments.tar.gz

snippets · 912 B · 2010-03-30

Comments v1.0 by Richard Lawrence: a Perl script that comments #else and #endif lines.

Download   « Back to the snippets list

comments/README

Comments v1.0
Richard Lawrence 2001
richard@custard.org

This code correctly comments #else and #endif's so they can be easily
paired up with their #if's, #ifdef's and #ifndef's.

Usage:    comments.pl filename.c > newfilename.c

Use at your own risk. Not fully tested.

Example:

#ifdef FISH
wibble
#ifndef CHIPS
wobble
#else
bongo
#else
babble
#endif
whoop
#endif

after conversion becomes:

#ifdef FISH
wibble
#ifndef CHIPS
wobble
#else /* CHIPS */
bongo
#endif /* !CHIPS */
whoop
#endif /* FISH */


Got a question? Updated the code? Contact me at richard@custard.org

Archive contents (2 files)

FileSize
comments/comments.pl908 B
comments/README572 B

Site Stats

Snippets: 1791
Codebases: 571