X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=tohtml.sh;h=8555d245b5387e14591496a39139c4562c6b18bb;hb=93b1d8b1f5f6ddbdf8f8af5190043e383498a7b7;hp=f71aa341f98dfc7f78e0182fe285dd65ac897d6b;hpb=c64643bdf1b0787fb2306ad75b19bf4e5deb07e6;p=c-standard
diff --git a/tohtml.sh b/tohtml.sh
index f71aa34..8555d24 100755
--- a/tohtml.sh
+++ b/tohtml.sh
@@ -39,6 +39,7 @@ BEGIN {
} else
print
}
+ note = 1
}
!seenindex && /^ *([1-9A-Z]\.|Annex|Index|Foreword|Introduction|Bibliography)/ {
@@ -63,6 +64,11 @@ BEGIN {
next
}
+/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns)$/ {
+ print "" $0 ""
+ next
+}
+
{
s = $0
p = ""
@@ -73,7 +79,7 @@ BEGIN {
while (match(s, r)) {
p = p substr(s,1,RSTART)
m = substr(s,RSTART+1,RLENGTH-1)
- if (m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ || substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z\-]/)
+ if (m ~ /\.0$/ || m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ || substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z\-]/)
p = p m
else
p = p "" m ""
@@ -98,7 +104,22 @@ BEGIN {
p = p m
s = substr(s,RSTART+RLENGTH)
}
- print p s
+ s = p s
+ p = ""
+ while (match(s, note "\\)")) {
+ if (note==1 && s !~ /\.1\)/)
+ break
+ p = p substr(s,1,RSTART-1)
+ p = p "" note ")"
+ note++
+ s = substr(s,RSTART+RLENGTH)
+ }
+ s = p s
+ if (s ~ /^ *[1-9][0-9]*\) /) {
+ sub(/\)/,"",s)
+ sub(/[0-9]+/,"&)",s)
+ }
+ print s
}
END { print "