Mercurial > octave
changeset 27945:72ed9d085196
munge-texi.pl: small cleanups to formatting and a regexp.
* munge-texi.pl: Use s'...'...' for search and replace which does
not require escaping at symbol '\@'. Re-format some comment lines
for readability.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 16 Jan 2020 12:12:02 -0800 |
parents | bceab42914f2 |
children | 14efec874546 |
files | doc/interpreter/munge-texi.pl |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/munge-texi.pl Wed Jan 15 22:22:23 2020 -0600 +++ b/doc/interpreter/munge-texi.pl Thu Jan 16 12:12:02 2020 -0800 @@ -41,8 +41,8 @@ # Load DOCSTRINGS into memory while expanding @seealso references foreach $DOCSTRING_file (@ARGV) { - ## DOCSTRINGS files may exist in the current (build) directory or in the - ## source directory when building from a release. + ## DOCSTRINGS files may exist in the current (build) directory OR + ## in the source directory when building from a release. $DOCSTRING_file_srcdir = "$top_srcdir/$DOCSTRING_file"; open (DOCFH, $DOCSTRING_file) or open (DOCFH, $DOCSTRING_file_srcdir) @@ -57,7 +57,7 @@ do { s/\s*$//; # strip EOL character(s) - $symbol = substr ($_,1); + $symbol = substr ($_, 1); $docstring = extract_docstring (); if ($help_text{$symbol}) { @@ -80,7 +80,7 @@ TXI_LINE: while (<STDIN>) { - s/\@seealso/\@xseealso/g; + s'@seealso'@xseealso'g; if (/^\s*\@DOCSTRING\((\S+)\)/) { @@ -132,7 +132,7 @@ # expand any @seealso references if (m'^@seealso\{') { - # Join multiple lines until full macro body found + # join multiple lines until full macro body found while (! /}/m) { $_ .= <DOCFH>; } ($arg_list, $rest_of_line) = m'^@seealso\{(.*)\}(.*)?'s; @@ -142,9 +142,9 @@ $repl = ""; foreach $func (split (/,/, $func_list)) { - $func =~ s/^@/@@/; # Texinfo uses @@ to produce '@' + $func =~ s/^@/@@/; # Texinfo uses @@ to produce '@' $node = $func; - $node =~ s/\./_/g; # Texinfo doesn't like '.' in node names + $node =~ s/\./_/g; # Texinfo doesn't like '.' in node names $repl .= "\@ref{XREF$node,,$func}, "; } substr($repl,-2) = ""; # Remove last ', '