Skip to content

Commit

Permalink
[check] Improve detection of missing concept markup
Browse files Browse the repository at this point in the history
  • Loading branch information
jensmaurer authored and tkoeppe committed Jan 2, 2025
1 parent 6e1d718 commit e78ef43
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/check-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,21 @@ cat std-conceptindex.ind |
# Find undecorated concept names in code blocks
patt="`cat std-conceptindex.ind |
sed 's/.hyperindexformat/\nhyperindexformat/;s/.hyperpage/\nhyperpage/' |
sed -n 's/^ .item.*{\([-a-z_]*\)}.*$/\1/p'`"
sed -n 's/^ .item.*{\([-a-z_]*\)}.*$/\1/p;s/^ .item.*frenchspacing \([a-z_]*\)}.*$/\1/p'`"

patt="`echo $patt | sed 's/ /\\\\|/g'`"
# $patt contains all concept names, separated by \| to use as a sed regex

for f in *.tex; do
sed -n 's,//.*$,,;s/%.*$//;s/"[^"]*"/""/;/begin{codeblock\(tu\)\?}/,/end{codeblock\(tu\)\?}/{/[^-_{a-z\]\('"$patt"'\)[^-_}a-z();]/{=;p;};}' $f |
# handle codeblock
sed -n 's,//.*$,,;s/%.*$//;s/"[^"]*"/""/;/begin{codeblock\(tu\)\?}/,/end{codeblock\(tu\)\?}/{/[^-_a-z\]\('"$patt"'\)[^-_}a-z0-9();,]/{=;p;};}' $f |
# prefix output with filename and line
sed '/^[0-9]\+$/{N;s/\n/:/;}' | sed "s/.*/$f:&/" |
grep -v "@.seebelow" |
sed "s/\$/ -- concept name without markup/" |
fail || failed=1
# handle itemdecl
sed -n 's,//.*$,,;s/%.*$//;s/"[^"]*"/""/;/begin{itemdecl}/,/end{itemdecl}/{/[^-_a-z]\('"$patt"'\)[^-_a-z();,]/{/concept{[a-z_-]*}/d;=;p;};}' $f |
# prefix output with filename and line
sed '/^[0-9]\+$/{N;s/\n/:/;}' | sed "s/.*/$f:&/" |
grep -v "@.seebelow" |
Expand Down

0 comments on commit e78ef43

Please sign in to comment.