From: wolf Date: Wed, 21 Jun 2000 12:46:42 +0000 (+0000) Subject: Import my changes to kdoc which did not make it yet into a release. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b28835effc4a5c46ce39151e8afac087138471e4;p=dealii-svn.git Import my changes to kdoc which did not make it yet into a release. git-svn-id: https://svn.dealii.org/trunk@3046 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/kdoc/src/kdoc b/deal.II/contrib/kdoc/src/kdoc index b7c0ca2c54..86219e287f 100755 --- a/deal.II/contrib/kdoc/src/kdoc +++ b/deal.II/contrib/kdoc/src/kdoc @@ -564,12 +564,14 @@ sub identifyDecl # Typedef elsif ( $decl =~ /^\s*typedef\s+ + (?:typename\s+)? # `typename' keyword (.*?\s*[\*&]?) # type - \s*([-\w_\:]+) # name + \s+([-\w_\:]+) # name + \s*(\[[-\w_\:<>\s]*\])? # array \s*[{;]\s*$/xs ) { - print "Typedef: <$1> <$2>\n" if $debug; - $newNode = newTypedef( $1, $2 ); + print "Typedef: <$1 $3> <$2>\n" if $debug; + $newNode = newTypedef( $1.$3, $2 ); } # Enum @@ -657,7 +659,7 @@ sub identifyDecl my $pure = $4 eq "" ? 0 : 1; if ( $tpn =~ /((?:\w+\s*::\s*)?operator.*?)\s*$/ # operator - || $tpn =~ /((?:\w*\s*::\s*~?)?[-\w:]+)\s*$/ ) { # normal + || $tpn =~ /((?:\w*(?:\s*<[\w\s_,]*>\s*)?\s*::\s*~?)?[-\w:]+)\s*$/ ) { # normal my $name = $1; $tpn = $`; $newNode = newMethod( $tpn, $name, @@ -1145,7 +1147,7 @@ sub newMethod print "Cracked: [$retType] [$name]\n\t[$params]\n\t[$const]\n" if $debug; - if ( $retType =~ /([\w\s_<>,]+)\s*::\s*$/ ) { + if ( $retType =~ /(\w+(<[\w\s_,]*>|\s*::\s*\w+)*)\s*::\s*$/ ) { # check if stuff before :: got into rettype by mistake. $retType = $`; ($name = $1."::".$name); diff --git a/deal.II/contrib/kdoc/src/kdocCxxHTML.pm b/deal.II/contrib/kdoc/src/kdocCxxHTML.pm index 2b2d0b35d2..58c1cddfda 100644 --- a/deal.II/contrib/kdoc/src/kdocCxxHTML.pm +++ b/deal.II/contrib/kdoc/src/kdocCxxHTML.pm @@ -688,7 +688,7 @@ EOF $type = $m->{NodeType}; $name = B( "b", $name ); - print CLASS "
  • "; + print CLASS "
  • \n"; if( $type eq "var" ) { print CLASS esc( $m->{Type}), " $name\n"; @@ -721,7 +721,7 @@ EOF print CLASS esc($type), " $name\n"; } - print CLASS "
  • \n"; + print CLASS "\n\n"; } print CLASS<

    \n"; + print CLASS "\n\n

    \n"; } if( $type eq "DocText" ) { print CLASS "", deref( $name, $rootnode ); } elsif ( $type eq "Pre" ) { - print CLASS "

    \n",
    -					esc( $name ), "\n

    "; + print CLASS "

    \n\n
    \n",
    +					esc( $name ), "\n
    \n\n

    \n"; } elsif( $type eq "Ref" ) { my $ref = $node->{Ref}; @@ -414,19 +414,19 @@ sub printDoc } } elsif ( $type eq "DocSection" ) { - print CLASS "

    ", - deref( $name, $rootnode),"

    "; + print CLASS "

    \n\n

    ", + deref( $name, $rootnode),"

    \n

    \n"; } elsif ( $type eq "Image" ) { - print CLASS "

    {Path}, "\">

    "; + print CLASS "

    \n{Path}, "\">\n

    \n"; } elsif ( $type eq "ParaBreak" ) { - print CLASS "

    "; + print CLASS "

    \n\n

    "; } elsif ( $type eq "ListItem" ) { if ( $lasttype ne "ListItem" ) { - print CLASS "

    \n\n

    \n"; } - print CLASS "

    "; + print CLASS "

    \n"; } @@ -602,18 +602,43 @@ sub deref my $out = ""; my $text; - foreach $text ( split (/(\@\w+\s+[\w:#]+)/, $str ) ) { - if ( $text =~ /\@ref\s+([\w:#]+)/ ) { - my $name = $1; - $name =~ s/^\s*#//g; - $out .= wordRef( $name, $rootnode ); - } - elsif ( $text =~ /\@p\s+([\w:#]+)/ ) { - $out .= "".esc($1).""; - } - elsif ( $text =~/\@em\s+(\w+)/ ) { # emphasized - $out .= "".esc($1).""; + # escape @x commands + foreach $text ( split (/(\@\w+(?:\s+.+?(?=\s)|\{.*?\}))/, $str ) ) { + + # check whether $text is an @command or the text between + # @commands + if ( $text =~ /\@(\w+)(?:\s+(.+?)(?:\s|$)|\{(.*?)\})/ ) { + my $command = $1; + my $content = $2 . $3; + + # @ref -- cross reference + if ( $command eq "ref" ) { + $content =~ s/^\s*#//g; + $out .= wordRef( $content, $rootnode ); + } + + # @p -- typewriter + elsif ( $command eq "p" ) { + $out .= "".esc($content).""; + } + + # @em -- emphasized + elsif ( $command eq "em" ) { + $out .= "".esc($content).""; + } + + # @sect1-4 -- section header + elsif ( $command =~ /^sect([1-4])$/ ) { + $out .= "".esc($content).""; + } + + # unknown command. warn and copy command + else { + print "Unknown command @", $command, "\n"; + $out .= esc($text); + } } + # no @x command, thus regular text else { $out .= esc($text); }