Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2022-10-29 18:43:50 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2022-11-12 17:09:11 +0300
commitc03f0c306244bf73239cb1a318a175682f504dc2 (patch)
tree9501e8ebe56ebeac13c80ca1b2f936d8973dfeb4
parent999925b253882ff4c3c47c9a4b91c5cb0d39e84d (diff)
makedocbook: Fix false report of unhandled texinfo command
During 'make man', makedocbook falsely reports "texinfo command '@modifier' remains in output" while processing the setlocal(3) manpage, which contains that literal string. Move the check for unrecognized texinfo commands to before processing '@@' (an escaped '@') in the texinfo source, and teach it to ignore them. Improve that check slightly, so it catches non-alphabetic texinfo commands, of which there are few. Now we don't have false positives, we can make unrecognized texinfo commands fatal to manpage generation, rather than leaving them verbatim in the generated manpage.
-rwxr-xr-xnewlib/doc/makedocbook.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/newlib/doc/makedocbook.py b/newlib/doc/makedocbook.py
index 4de20ef92..9c5615f22 100755
--- a/newlib/doc/makedocbook.py
+++ b/newlib/doc/makedocbook.py
@@ -450,9 +450,6 @@ command_dispatch_dict = {
def line_markup_convert(p):
s = p
- # process the texinfo escape for an @
- s = s.replace('@@', '@')
-
# escape characters not allowed in XML
s = s.replace('&', '&amp;')
s = s.replace('<', '&lt;')
@@ -482,6 +479,14 @@ def line_markup_convert(p):
# very hacky way of dealing with @* to force a newline
s = s.replace('@*', '</para><para>')
+ # fail if there are unhandled texinfo commands
+ match = re.search(r'(?<!@)@[^@\s]+', s)
+ if match:
+ sys.exit("texinfo command '%s' remains in output" % match.group(0))
+
+ # process the texinfo escape for an @
+ s = s.replace('@@', '@')
+
if (verbose > 3) and (s != p):
print('%s-> line_markup_convert ->\n%s' % (p, s), file=sys.stderr)
@@ -823,10 +828,6 @@ def main(file):
print(s)
- # warn about texinfo commands which didn't get processed
- match = re.search(r'@[a-z*]+', s)
- if match:
- print('texinfo command %s remains in output' % match.group(), file=sys.stderr)
#
#