[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kdoc
Subject: Re: Small bugs
From: Hans Martens <HMartens () jasongeo ! com>
Date: 2000-05-02 13:11:02
[Download RAW message or body]
> > 1) It fails to parse inline template constructors. E.g.
> >
> > <snip>
>
> Can you try whether this patch fixes it?
>
> --- kdoc.3 Mon Feb 14 12:31:25 2000
> +++ kdoc Tue May 2 13:59:45 2000
> @@ -659,7 +659,7 @@
> my $pure = $4 eq "" ? 0 : 1;
>
> if ( $tpn =~ /((?:\w+\s*::\s*)?operator.*?)\s*$/ #operator
> - || $tpn =~ /((?:\w*\s*::\s*~?)?[-\w:]+)\s*$/ ) { # normal
> + || $tpn =~ /((?:\w*(?:<[\w\s_,]*>)?\s*::\s*~?)?[-\w:]+)\s*$/ ) { # normal
> my $name = $1;
> $tpn = $`;
> $newNode = newMethod( $tpn, $name,
Tried that. Works partially. For one class i.s.o. "'KeyedDataSels' has
no KidAccess", I now get
findRef: no name at
/home/hans/tools/Any/kdoc/kdoc-2.0a35/share/kdoc/kdocAstUtil.pm line 101
kdocAstUtil::findRef('Ast=HASH(0x222ad4)', '') called at
/home/hans/tools/SunOS/bin/kdoc line 1177
main::newMethod('template < class KeyType, class DataType >
KeyedDataSels ', '< KeyType, DataType > :: KeyedDataSels', '', 0, 0)
called at /home/hans/tools/SunOS/bin/kdoc line 664
main::identifyDecl('template < class KeyType, class DataType >
KeyedDataSels < KeyTy...') called at /home/hans/tools/SunOS/bin/kdoc
line 259
main::parseFiles() called at /home/hans/tools/SunOS/bin/kdoc
line 161
*** Error code 2
Code for this class is e.g.
template < class KeyType, class DataType >
KeyedDataSels < KeyType, DataType > :: KeyedDataSels()
{}
template < class KeyType, class DataType >
KeyedDataSels < KeyType, DataType > :: KeyedDataSels(const KeyedDataSels
<KeyType, DataType> &kds)
{
copy(kds);
}
> Gee! I have approx 10 years of C++ experience, but I didn't know such a
> thing was possible. I'd say, that's perverse, so I will certainly not work
> on that ;-) You may try yourself, but a look at the respective function in
> kdoc reveals that this is probably not so simple.
>
> Unrelated question: why do you write such a line in the beginning?
I agree with you completely. However, there is such a thing as legacy
code... (Some programmers seem to feel that the quality of a program is
inversely proportional to its ASCII code length ;-)
Cheers,
Hans
BTW, I fixed some other small problems which you may or may not have
found:
1) file 'kdoc', line 108, parsing the cppcmp option should read
"cppcmd|C=s", \$cppcmd,
2) Since I sometimes get empty HREF's in my HTML documentation, file
'kdocHTMLutil.pm', subroutine 'sub-hyper' changed to:
sub hyper
{
confess "hyper: undefed parameter $_[0], $_[1]"
unless defined $_[0] && defined $_[1];
my $out = "";
if ($_[0] ne "") { ## filter out empty refs
$out = "<A HREF=\"$_[0]\">".esc($_[1])."</A>";
}
else {
$out = esc($_[1]);
}
return $out;
}
3) For similar reasons, in subroutine 'writeNode' in file 'kdocLib.pm',
change
print LIB "<C NAME=\"", $n->{astNodeName},
"\" REF=\"$prefix.html\">\n";
to
if( $prefix ne "" ) { ## filter out empty refs
print LIB "<C NAME=\"", $n->{astNodeName},
"\" REF=\"$prefix.html\">\n";
}
4) Similarly, further down in the same subroutine:
print LIB "<$type NAME=\"", $kid->{astNodeName},
"\" REF=\"$prefix.html#", $kid->{astNodeName}, "\">\n";
to
if ($prefix ne "") { ## filter out empty refs
print LIB "<$type NAME=\"", $kid->{astNodeName},
"\" REF=\"$prefix.html#", $kid->{astNodeName}, "\">\n";
}
I have not really checked what causes the empty refs, I'm afraid, I
removed them "phenomenologically".
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic