From d73d982a62049f7d9d366aae2e130a0a7b736cb6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 14 Aug 2023 21:49:36 +0200 Subject: [PATCH] [lib] Avoid redundant \tcode{\exposid{...}} and add a check --- source/containers.tex | 12 ++++++------ source/locales.tex | 6 +++--- source/ranges.tex | 2 +- tools/check-source.sh | 4 ++++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 77cde090b4..21abef6cad 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -18389,8 +18389,8 @@ \pnum \effects -Initializes \tcode{\exposid{data_}} with \tcode{to_address(first)} and -\tcode{\exposid{size_}} with \tcode{count}. +Initializes \exposid{data_} with \tcode{to_address(first)} and +\exposid{size_} with \tcode{count}. \pnum \throws @@ -18432,8 +18432,8 @@ \pnum \effects -Initializes \tcode{\exposid{data_}} with \tcode{to_address(first)} and -\tcode{\exposid{size_}} with \tcode{last - first}. +Initializes \exposid{data_} with \tcode{to_address(first)} and +\exposid{size_} with \tcode{last - first}. \pnum \throws @@ -18510,8 +18510,8 @@ \pnum \effects -Initializes \tcode{\exposid{data_}} with \tcode{ranges::data(r)} and -\tcode{\exposid{size_}} with \tcode{ranges::size(r)}. +Initializes \exposid{data_} with \tcode{ranges::data(r)} and +\exposid{size_} with \tcode{ranges::size(r)}. \pnum \throws diff --git a/source/locales.tex b/source/locales.tex index ce87b0d573..e36f215d68 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -4855,7 +4855,7 @@ \begin{itemdescr} \pnum \returns -\tcode{\exposid{mib_}}. +\exposid{mib_}. \end{itemdescr} \indexlibrarymember{name}{text_encoding}% @@ -4866,7 +4866,7 @@ \begin{itemdescr} \pnum \returns -\tcode{\exposid{name_}} if \tcode{(\exposid{name_}[0] != '\textbackslash 0')} +\exposid{name_} if \tcode{(\exposid{name_}[0] != '\textbackslash 0')} is \tcode{true}, and \keyword{nullptr} otherwise. @@ -4874,7 +4874,7 @@ \remarks If \tcode{name() == nullptr} is \tcode{false}, \tcode{name()} is an \ntbs{} and -accessing elements of \tcode{\exposid{name_}} +accessing elements of \exposid{name_} outside of the range \countedrange{name()}{strlen(name()) + 1} is undefined behavior. \end{itemdescr} diff --git a/source/ranges.tex b/source/ranges.tex index eaddf6ba39..1605080fee 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -13529,7 +13529,7 @@ using @\exposid{Base}@ = @\exposid{maybe-const}@; // \expos iterator_t<@\exposid{Base}@> @\exposid{current_}@ = iterator_t<@\exposid{Base}@>(); // \expos iterator_t<@\exposid{Base}@> @\exposid{last_ele_}@ = iterator_t<@\exposid{Base}@>(); // \expos, - // present only if \tcode{\exposid{Base}} models \tcode{\exposconcept{slide-caches-first}} + // present only if \exposid{Base} models \tcode{\exposconcept{slide-caches-first}} range_difference_t<@\exposid{Base}@> @\exposid{n_}@ = 0; // \expos constexpr @\exposid{iterator}@(iterator_t<@\exposid{Base}@> current, range_difference_t<@\exposid{Base}@> n) // \expos diff --git a/tools/check-source.sh b/tools/check-source.sh index 3af7f80691..97c15335e4 100755 --- a/tools/check-source.sh +++ b/tools/check-source.sh @@ -83,6 +83,10 @@ fgrep -n '\^' $texfiles | grep -n 'U+' $texfiles | fail 'use \\unicode or \\ucode or \\uname instead' || failed=1 +# Discourage double-wrapping \tcode{\exposid{data_}} +grep -n '\\tcode{\\exposid{[a-zA-Z0-9_]*}}' $texfiles | + fail 'double-wrapped \\exposid in \\tcode' || failed=1 + # Hex digits inside \ucode and \unicode must be lowercase so that \textsc works grep -n 'ucode{[^}]*[^0-9a-f}][^}]*}' $texfiles | fail 'use lowercase hex digits inside \\ucode' || failed=1