* Fixed bug: 'type*' and 'type&' are not converted to \ccc{type*} and \ccc{type&}.

* Fixed bug: in class A, expressions with 2 levels of template like A<B<C>> are nor properly parsed.
-This line, and those below, will be ignored--

M    copy_doxygen_latex_doc
This commit is contained in:
Laurent Saboret 2009-06-17 07:38:44 +00:00
parent c5fdd0eb17
commit 3b12ebe45a
1 changed files with 10 additions and 10 deletions

View File

@ -159,8 +159,10 @@ sub latex_unmangle
# Get parameter: buffer containing a doxygen-generated latex file # Get parameter: buffer containing a doxygen-generated latex file
my $buf = shift; my $buf = shift;
# Avoid tabs and consecutive spaces to ease parsing in the rest of this script # First: avoid tabs, consecutive spaces and trailing spaces
# to ease parsing in the rest of this script.
$buf =~ s/( |\t)+/ /g; $buf =~ s/( |\t)+/ /g;
$buf =~ s/ +\n/\n/g;
# Convert buffer back to Doxygen 1.5.5 format # Convert buffer back to Doxygen 1.5.5 format
$buf =~ s/\\paragraph\[\{.*?\}\]/\\paragraph/g; # remove \paragraph[...] -> \paragraph $buf =~ s/\\paragraph\[\{.*?\}\]/\\paragraph/g; # remove \paragraph[...] -> \paragraph
@ -237,17 +239,15 @@ sub doxygen_latex_to_latex
$buf =~ s/\n?\\begin\{Desc\}/\n\\begin\{Desc\}/smg; $buf =~ s/\n?\\begin\{Desc\}/\n\\begin\{Desc\}/smg;
# Use a canonic style to ease parsing # Use a canonic style to ease parsing
$buf =~ s/ *, *([^\\])/, $1/g; # Use a canonic style "item1, item2" for lists $buf =~ s/ *, *([^\\])/, $1/g; # Use a canonic style "item1, item2" for lists.
$buf =~ s/([\w\>]+)\s*&\s*/$1& /g; # Use a canonic style "type& variable" for references $buf =~ s/([\w\>]+) *& *([^\'])/$1& $2/g; # Use a canonic style "type& variable" for references
$buf =~ s/(\w)=/$1 =/g; # Use a canonic style "variable = default" for default parameters # without modifying 'type&'.
$buf =~ s/(\w)=/$1 =/g; # Use a canonic style "variable = default" for default. parameters
$buf =~ s/=(\w)/= $1/g; # "" $buf =~ s/=(\w)/= $1/g; # ""
$buf =~ s/<\s*(.*?)\s*>/<$1>/g; # Use a canonic style "type<parameters>" for template parameters $buf =~ s/<\s*(.*?)\s*>/<$1>/g; # Use a canonic style "type<parameters>" for template. parameters
$buf =~ s/Constructor& Destructor/Constructor & Destructor/g; $buf =~ s/Constructor& Destructor/Constructor & Destructor/g;
$buf =~ s/\\item\[(.*?): +\]/\\item\[$1:\]/g; $buf =~ s/\\item\[(.*?): +\]/\\item\[$1:\]/g;
# Remove trailing spaces to ease parsing
$buf =~ s/ +\n/\n/g;
# "Desc" is a doxygen style based on "description". # "Desc" is a doxygen style based on "description".
# "CompactItemize" is a doxygen style based on "itemize". # "CompactItemize" is a doxygen style based on "itemize".
$buf =~ s/\{Desc\}/\{description\}/g; $buf =~ s/\{Desc\}/\{description\}/g;
@ -288,7 +288,7 @@ sub latex_mangle
# 1) Trust user: wrap words surrounded by simple quotes by \ccc{} [L. Saboret's extension]. # 1) Trust user: wrap words surrounded by simple quotes by \ccc{} [L. Saboret's extension].
# Note: we use a one-liner to not insert a \ccc{} call inside an another one. # Note: we use a one-liner to not insert a \ccc{} call inside an another one.
$buf =~ s/\'(((::|\w)+(<.*?>)?)+)\'/\\ccc\{$1\}/g; $buf =~ s/\'(((::|\w)+(<.*?>)?)+&?\**)\'/\\ccc\{$1\}/g;
# Add carriage returns around \ccc{} for the line by line substitution below. # Add carriage returns around \ccc{} for the line by line substitution below.
# Note: make sure to insert only one \n before and after each \ccc{} call. # Note: make sure to insert only one \n before and after each \ccc{} call.
@ -719,7 +719,7 @@ sub format_doxygen_class_doc
# Remove CGAL:: and $className:: prefixes (implicit) # Remove CGAL:: and $className:: prefixes (implicit)
$buf =~ s/CGAL::(\w+)/$1/g; $buf =~ s/CGAL::(\w+)/$1/g;
$buf =~ s/$className(<.*?>)?::(\w+)/$2/g; $buf =~ s/$className(<[^<]*?>)?::(\w+)/$2/g;
# Rename (for a class/struct) or delete (for a concept) the include file # Rename (for a class/struct) or delete (for a concept) the include file
# and insert \ccSeeAlso title at the end of the document. # and insert \ccSeeAlso title at the end of the document.