X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=etc%2Ftexi2pod.pl;h=8d92bcf6023bd26ec687e8ae6b29e390b52339e6;hb=37ab86550b9da31d6c32c2d3384bd27f0426e935;hp=57d1d5bcd63202ec8d9358863f7fdf39249900d9;hpb=b02e2fdabec1f0f18cab48f04ad6b1b8ce4f47bc;p=deliverable%2Fbinutils-gdb.git diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl index 57d1d5bcd6..8d92bcf602 100644 --- a/etc/texi2pod.pl +++ b/etc/texi2pod.pl @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +# Copyright (C) 1999-2019 Free Software Foundation, Inc. # This file is part of GCC. @@ -162,6 +162,8 @@ while(<$inf>) { } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { $_ = "\n=back\n"; $ic = pop @icstack; + } elsif ($ended eq "multitable") { + $_ = "\n=back\n"; } else { die "unknown command \@end $ended at line $.\n"; } @@ -239,8 +241,10 @@ while(<$inf>) { # Try cwd and $ibase, then explicit -I paths. $done = 0; - foreach $path (".", $ibase, @ipath) { - open($inf, "<" . $path . "/" . $file) and ($done = 1, last); + foreach $path ("", $ibase, @ipath) { + $mypath = $file; + $mypath = $path . "/" . $mypath if ($path ne ""); + open($inf, "<" . $mypath) and ($done = 1, last); } die "cannot find $file" if !$done; next; @@ -250,6 +254,8 @@ while(<$inf>) { and $_ = "\n=head2 $1\n"; /^\@subsection\s+(.+)$/ and $_ = "\n=head3 $1\n"; + /^\@subsubsection\s+(.+)$/ + and $_ = "\n=head4 $1\n"; # Block command handlers: /^\@itemize(?:\s+(\@[a-z]+|\*|-))?/ and do { @@ -258,7 +264,7 @@ while(<$inf>) { if (defined $1) { $ic = $1; } else { - $ic = '@bullet'; + $ic = '*'; } $_ = "\n=over 4\n"; $endw = "itemize"; @@ -276,6 +282,12 @@ while(<$inf>) { $endw = "enumerate"; }; + /^\@multitable\s.*/ and do { + push @endwstack, $endw; + $endw = "multitable"; + $_ = "\n=over 4\n"; + }; + /^\@([fv]?table)\s+(\@[a-z]+)/ and do { push @endwstack, $endw; push @icstack, $ic; @@ -295,6 +307,16 @@ while(<$inf>) { $_ = ""; # need a paragraph break }; + /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do { + @columns = (); + for $column (split (/\s*\@tab\s*/, $1)) { + # @strong{...} is used a @headitem work-alike + $column =~ s/^\@strong\{(.*)\}$/$1/; + push @columns, $column; + } + $_ = "\n=item ".join (" : ", @columns)."\n"; + }; + /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below. @@ -318,7 +340,7 @@ die "No filename or title\n" unless defined $fn && defined $tl; $sects{NAME} = "$fn \- $tl\n"; $sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES}; -for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES +for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) { if(exists $sects{$sect}) { $head = $sect; @@ -359,6 +381,7 @@ sub postprocess s/\@file\{([^\}]*)\}/F<$1>/g; s/\@w\{([^\}]*)\}/S<$1>/g; s/\@(?:dmn|math)\{([^\}]*)\}/$1/g; + s/\@t\{([^\}]*)\}/$1/g; # keep references of the form @ref{...}, print them bold s/\@(?:ref)\{([^\}]*)\}/B<$1>/g; @@ -380,6 +403,9 @@ sub postprocess s/\@gol//g; s/\@\*\s*\n?//g; + # Anchors are thrown away + s/\@anchor\{(?:[^\}]*)\}//g; + # @uref can take one, two, or three arguments, with different # semantics each time. @url and @email are just like @uref with # one argument, for our purposes.