X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ann2html.sh;h=d5f9042963b69b84df0e55c8cafa65f9be4b5a12;hb=23a67101d272654dc45920a5ef98dc72a7512b12;hp=ecb0411ebda6c2d67e54b4f8dfd4f4a5ce686d2d;hpb=64ee437a499e51415f53367a1c0be1c371b298d1;p=c-standard diff --git a/ann2html.sh b/ann2html.sh index ecb0411..d5f9042 100755 --- a/ann2html.sh +++ b/ann2html.sh @@ -133,7 +133,7 @@ seencontents && !seenfore && /^[^@]/ { /^@end pre/ { if (!pre) next - pre = pre "\n" + pre = pre "\n\n" if (nn) note[nn] = note[nn] "\n" pre else @@ -161,7 +161,7 @@ seencontents && !seenfore && /^[^@]/ { next } -/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits)$/ { +/^ ?(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits|Environmental limits)$/ { ss[sid] = ss[sid] "
" $0 "
\n" next } @@ -211,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)