X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ann2html.sh;h=8999198a11a788d8324dbb5364a398b8e3eb4713;hb=c8552f228e75429c8c11edb869899f05b70ea1e5;hp=3e2e1760d4eed011d9da1b4774b7a95da46e1e9f;hpb=7df8cd2a500cd0285ce82e96357a0d7e06b3956f;p=c-standard
diff --git a/ann2html.sh b/ann2html.sh
index 3e2e176..8999198 100755
--- a/ann2html.sh
+++ b/ann2html.sh
@@ -85,6 +85,10 @@ seencontents && !seenfore && /^[^@]/ {
next
}
+/^@sect 3\./ {
+ markdef = 1
+}
+
/^@sect/ {
sid++
slevel = split($2,a,/\./)+1
@@ -93,7 +97,7 @@ seencontents && !seenfore && /^[^@]/ {
sect = $2
getline
# todo hX, back to top
- ss[sid] = sprintf("
\n" next @@ -157,7 +161,7 @@ seencontents && !seenfore && /^[^@]/ { next } -/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns)$/ { +/^ ?(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits|Environmental limits)$/ { ss[sid] = ss[sid] "" $0 "
\n" next } @@ -207,7 +211,19 @@ seencontents && !seenfore && /^[^@]/ { } s = p s p = "" - while (match(s, noteid "\\)")) { + # TODO: false positives.. + while (match(s, /[a-z]opt[ )]/)) + s = substr(s,1,RSTART) "opt" substr(s,RSTART+RLENGTH-1) + if (match(s, /[a-z]opt$/)) + s = substr(s,1,RSTART) "opt" + for (;;) { + while (match(s, noteid-1 "\\)")) { + p = p substr(s,1,RSTART-1) + p = p "" noteid-1 ")" + s = substr(s,RSTART+RLENGTH) + } + if (!match(s, noteid "\\)")) + break if (noteid==1 && s !~ /\.1\)/) break p = p substr(s,1,RSTART-1) @@ -218,6 +234,10 @@ seencontents && !seenfore && /^[^@]/ { } s = p s sub(/^ *Forward references/, "&", s) + if (markdef) { + s = "" s "
" + markdef = 0 + } if (pre) pre = pre "\n" s else if (nn)