OSDN Git Service

contrib:
[pf3gnuchains/gcc-fork.git] / contrib / texi2pod.pl
index dc9a68b..964c033 100755 (executable)
@@ -192,7 +192,7 @@ while(<STDIN>)
        push @endwstack, $endw;
        push @icstack, $ic;
        $ic = $1;
-       $ic =~ s/\@(?:samp|strong|key)/B/;
+       $ic =~ s/\@(?:samp|strong|key|gcctabopt|env)/B/;
        $ic =~ s/\@(?:code|kbd)/C/;
        $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
        $ic =~ s/\@(?:file)/F/;
@@ -249,30 +249,36 @@ sub postprocess
     s/\@value\{([a-zA-Z0-9_-]+)\}/$defs{$1}/g;
 
     # Formatting commands.
+    # Temporary escape for @r.
+    s/\@r\{([^\}]*)\}/R<$1>/g;
     s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
     s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:samp|strong|key|option|env|b)\{([^\}]*)\}/B<$1>/g;
+    s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
     s/\@sc\{([^\}]*)\}/\U$1/g;
     s/\@file\{([^\}]*)\}/F<$1>/g;
     s/\@w\{([^\}]*)\}/S<$1>/g;
     s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
 
+    # Handle @r inside bold.
+    1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B</g;
+
     # Cross references are thrown away, as are @noindent and @refill.
     # (@noindent is impossible in .pod, and @refill is unnecessary.)
     # @* is also impossible in .pod; we discard it and any newline that
-    # follows it.
+    # follows it.  Similarly, our macro @gol must be discarded.
 
-    s/\@xref\{(?:[^\}]*)\}[^.]*.//g;
+    s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
     s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
     s/;\s+\@pxref\{(?:[^\}]*)\}//g;
     s/\@noindent\s*//g;
     s/\@refill//g;
+    s/\@gol//g;
     s/\@\*\s*\n?//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.
-    s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;C<$1>&gt;/g;
+    s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;B<$1>&gt;/g;
     s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
     s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;