[idldoc] Suggestions for fixing up code - IDLDoc 3.0

Joe Hood jhood at akoostix.com
Sun Jan 13 19:29:52 PST 2008


Here is a list of sed scripts that I used to tidy up my code for  
IDLDoc 3.0.

As noted in ticket #25 on http://idldoc.idldev.com some of these won't  
be bulletproof, but they may help. I suggest doing a diff between new  
and old to confirm that it worked on your code base, if you decide to  
use them. I got rid of about 750 warnings with them, so I hope they  
can be of help.

# in every *.pro file find lines with @file_comments and replace just  
that text with nothing
# Note this isn't a problem anymore, but you still may wish to remove  
them as they aren't needed at the file level.
# This will be dangerous if you have @file_comments at the routine  
level!!!

  find . -type f -name '*.pro' -exec sed -i 's/@file_comments//g' {} \;

# in every *.pro file find lines with @inherits and delete them
# as noted in ticket #25 it only works if all related info is on the  
same line

find . -type f -name '*.pro' -exec sed -i '/@inherits/ D' {} \;

## The next set is to remove whitespace between ;- and pro of function  
definitions.
# This could also pull file comments up close in some cases so be sure  
this will work for you.

# remove all trailing whitespace to ensure next matching will work.
find . -type f -name '*.pro' -exec sed -i 's/[ \t]*$//' {} \;

# find blank line between ;- and pro/PRO IDL definition and remove it
# NOTE: i makes it case insensitive
# NOTE: this needs to be multiline. With N it seems you need a newline  
after it to work,
#              though someone may know other ways to do this.
# You can do something similar for functions, and add in extra 'N' and  
'\n' to catch two blank lines, etc.

find . -type f -name '*.pro' -exec sed -i '
  /;-/ {
         N
         N
         {
         s/;-\n\npro/;-\npro/i
         }
}' {} \;

Joe Hood, MSc, BEng, CD
President / Chief Technical Officer
Akoostix Inc.
jhood at akoostix.com
Phone: (902) 404-7464
Cell:     (902) 223-9876
Fax:     (902) 405-3855




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idldev.com/pipermail/idldoc-idldev.com/attachments/20080113/6a63b9dd/attachment.htm>


More information about the idldoc mailing list