[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kdoc
Subject: Re: inheriting from templates
From: Wolfgang Bangerth <wolf () gaia ! IWR ! Uni-Heidelberg ! De>
Date: 1999-04-13 13:45:37
[Download RAW message or body]
On Tue, 13 Apr 1999, Marcin Kasperski wrote:
> kdoc has trouble with inheriting from templates. Sample kdoc log:
> ...
The following patch against todays snapshot fixes the problem.
Regards
Wolfgang
*** kdoc-i/bin/kdoc Tue Apr 13 13:49:49 1999
--- kdoc-i/bin/kdoc1 Tue Apr 13 15:17:21 1999
***************
*** 426,432 ****
if( $rest =~ /^\s*:\s*/ ) {
$rest = $';
! @inherits = split /\s*,\s*/, $rest;
if ( $debug ) {
foreach $rest ( @inherits ) {
--- 426,464 ----
if( $rest =~ /^\s*:\s*/ ) {
$rest = $';
! $rest =~ s/\s+$//g;
! # split the inheritance list into the base classes. this
! # is a bit tricky since the commas separating the bases
! # can also occur in template arg lists
! #
! # therefore: split first at all comma sites and then
! # re-join several of the parts if necessary
! my @inheritsRaw = split /\s*,\s*/, $rest;
! my $part, $lastBaseClass;
! $lastBaseClass = shift ( @inheritsRaw );
! foreach $part ( @inheritsRaw ) {
! # check if the last base class has some
! # unbalanced '<' signs. if so, add the
! # present part, otherwise it starts a new
! # base class's name
! #
! # (note the ." " which is necessary since perl
! # throws away trailing empty strings from split
! # if the last char was a '>')
! my $nLeft = split (/</, $lastBaseClass." ") -1;
! my $nRight = split (/>/, $lastBaseClass." ") -1;
!
! if ($nLeft != $nRight) {
! $lastBaseClass .= ", " . $part;
! } else {
! push (@inherits, $lastBaseClass);
! $lastBaseClass = $part;
! }
! };
! # push last element
! if ( length($lastBaseClass) ) {
! push (@inherits, $lastBaseClass);
! }
if ( $debug ) {
foreach $rest ( @inherits ) {
-------------------------------------------------------------------------
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