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

List:       kde-kdoc
Subject:    Don't know what this regexp does
From:       Wolfgang Bangerth <wolf () gaia ! IWR ! Uni-Heidelberg ! De>
Date:       1999-01-19 15:47:37
[Download RAW message or body]


Hi there,

I have a problem with the following class declaration:
/**
 *    abc /
 *    cde
 */
class X {
};

The problem is with lines ending with a slash and the (erroneously)
matching regexp is the  'elsif' statement  in the following snippet:

		while ( $end == 0 )
		{
		    $_ = <IN>;
		    $line = $_;

		    if ( /^\s*\*\// )
		    {
		    	# end of documentation, assume class
			# declaration is next.

			$end = 1;
		    }
		    elsif ( /^(.*)\**\/\s*$/ && ($strictParser == 0) ) 
		    {
			# end of class documentation, with extraneous
			# space before end tag
			# only used if we are being lenient.

			$text = $text .  $1 . '\n';

			$end = 1;

			print "BAD CLASSDOC END: $_\n" if $debug == 1;
		    }


This can be found in 'kdoc', function 'processFile'. The regexp
matches zero or more asterisks followed by a slash and spaces. It
surely should have been one or more asterisks, so the patch is as
appended. Regards,
  Wolfgang


Index: kdoc
===================================================================
RCS file: /home/people/cvs/deal/deal.II/doc/kdoc/kdoc,v
retrieving revision 1.10
diff -C6 -r1.10 kdoc
*** kdoc	1999/01/19 15:45:21	1.10
--- kdoc	1999/01/19 15:46:11
***************
*** 880,892 ****
  		    if ( /^\s*\*\// )
  		    {
  		    	# end of documentation, assume class
  			# declaration is next.
  			$end = 1;
  		    }
! 		    elsif ( /^(.*)\**\/\s*$/ && ($strictParser == 0) ) 
  		    {
  			# end of class documentation, with extraneous
  			# space before end tag
  			# only used if we are being lenient.
  
  			$text = $text .  $1 . '\n';
--- 880,892 ----
  		    if ( /^\s*\*\// )
  		    {
  		    	# end of documentation, assume class
  			# declaration is next.
  			$end = 1;
  		    }
! 		    elsif ( /^(.*)\*+\/\s*$/ && ($strictParser == 0) ) 
  		    {
  			# end of class documentation, with extraneous
  			# space before end tag
  			# only used if we are being lenient.
  
  			$text = $text .  $1 . '\n';


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

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

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