aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/frontend-passes.cc
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@aarsen.me>2023-02-23 11:27:11 +0100
committerGerald Pfeifer <gerald@pfeifer.com>2023-02-23 23:42:01 +0100
commitf33d7a88d069d169bbe76da8e5c52de17f68ca05 (patch)
tree6d399142c972278067733d030a73fb2e807af488 /gcc/fortran/frontend-passes.cc
parentf83e76c3f998c8708fe2ddca16ae3f317c39c37a (diff)
downloadgcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.zip
gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.gz
gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.bz2
**/*.texi: Reorder index entries
This change is a generalization of r13-6292-gddf6fe375d9110. Historically, makeinfo exhibited a bug, due to which a structure like: @item foo @cindex foo @cindex bar ... would be transformed into an item heading, with the first index entry on it, followed by an item body, with the second index entry in it. This has often lead to index entries not linking to relevant items, but rather, just below them. This bug was exhibited in both Info and HTML documentation, and was most glaringly obvious in the latter. After a discussion with the Texinfo developers, it was decided that the appropriate construct for this case is: @cindex foo @cindex bar @item foo ... which behaves correctly in newer versions, linking all the index entries to the item itself. This pattern also produces copiable anchors in HTML output. This commit fixes most indices to follow the pattern above, however, omits relevant changes in the Ada manuals, as the algorithm described below lead to many false positives and unwanted changes in that manual. Much like the previous commit, this change is mostly mechanical, with a simple script. I have, however, gone over the patch myself also, to see if there's anything that ought to be kept as-is. Formatter: # GPL3+ use v5.35; use strict; use warnings; my @lineq = (); my @itemq = (); my @indxq = (); my $lstin = 0; while (<>) { push (@lineq, $_); if (/^\@[a-zA-Z0-9]{1,2}index\W/) { $lstin = @lineq; push (@indxq, $_); next; } if (/^\@itemx?\W/) { $lstin = @lineq; push (@itemq, $_); next; } next if $lstin && /^\s*(\@c(omment)?\W.*)?$/; if (@indxq and @itemq) { print @indxq; print @itemq; print @lineq[$lstin..@lineq-1]; } else { print @lineq; } @lineq = (); @itemq = (); @indxq = (); $lstin = 0; } if (@indxq and @itemq) { print @indxq; print @itemq; print @lineq[$lstin..@lineq-1]; } else { print @lineq; } # Local Variables: # indent-tabs-mode: nil # End: gcc/d/ChangeLog: * implement-d.texi: Reorder index entries around @items. gcc/ChangeLog: * doc/cfg.texi: Reorder index entries around @items. * doc/cpp.texi: Ditto. * doc/cppenv.texi: Ditto. * doc/cppopts.texi: Ditto. * doc/generic.texi: Ditto. * doc/install.texi: Ditto. * doc/extend.texi: Ditto. * doc/invoke.texi: Ditto. * doc/md.texi: Ditto. * doc/rtl.texi: Ditto. * doc/tm.texi.in: Ditto. * doc/trouble.texi: Ditto. * doc/tm.texi: Regenerate. gcc/fortran/ChangeLog: * invoke.texi: Reorder index entries around @items. gcc/go/ChangeLog: * gccgo.texi: Reorder index entries around @items.
Diffstat (limited to 'gcc/fortran/frontend-passes.cc')
0 files changed, 0 insertions, 0 deletions