[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kdoc
Subject:    Small patch for member templates
From:       Wolfgang Bangerth <wolf () gaia ! IWR ! Uni-Heidelberg ! De>
Date:       1999-02-22 13:23:13
[Download RAW message or body]


Hi there,

maybe this is of no great help to others, but I send it nevertheless: when
using member template (i.e. templated member functions), and if the
  template <whatever>
is on a line of its own, as is often the case, then kdoc forgets to
associate it with the following function. A small patch cures this, but it
admittedly does not make kdoc understand what is really happening. Maybe
its of some help to someone anyway.

Regards
  Wolfgang


-------------------------------------------------------------------------
Wolfgang Bangerth            email:       wolf@gaia.iwr.uni-heidelberg.de
                             www: http://gaia.iwr.uni-heidelberg.de/~wolf




Index: kdoc
===================================================================
RCS file: /home/people/cvs/deal/doc/auto/scripts/kdoc/kdoc,v
retrieving revision 1.1
retrieving revision 1.3
diff -c -8 -r1.1 -r1.3
*** kdoc	1999/02/11 09:04:11	1.1
--- kdoc	1999/02/22 13:11:07	1.3
***************
*** 261,276 ****
--- 261,283 ----
  
      while ( <IN> )
      {
  	next if	/^\s*$/g;
  	
  # parse out // comments, except where in a string or 
  	s#//.*$##g unless m#"[^"]+".*//# || m#^\s*///#;
  
+ 
+ 	# if we find a "template <whatever>" on a single line,
+         # concatenate it with the next line
+         if ( /^\s*(template\s*<(([-\w,_\s]|<([-\w,+\s])+>)+)>\s*)\n/ ) {
+ 	    $_ = $1 . " " . <IN>;
+ 	}
+ 
  	$line = $_;
  
  	if ( /^\s*\}\s*;\s*(\/\/.*)?$/ )
  	{
  # end of class declaration
  # dump all stored stuff to file
  
  		print "CLASS END: $class\n" if $debug;
***************
*** 563,578 ****
--- 570,587 ----
  	# member documentation begins
  		processMemberDoc();
  	}
  
  	#### Member Function
  
  	elsif ( /^\s*([^\(]*)\s+([^\s\(]+)\s*\((.*)(\/\/.*)?$/ ) 
  	{
+ 	    # note that the return type may contain
+ 	    # template <whatever>!
  		processMethod( $1, $2, $3 );
  	}
  
      }
  
  } # processClass
   
  sub processMethod {

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic