summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-07-06 07:09:28 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-07-06 07:09:28 +0000
commitbec61dbdc6b638b4db03d40233c77727a7fcf692 (patch)
tree8bac082b025d1116b26e4f60911ec0f28fe5e417
parent076a0b559893edbb47b6d433c3e360fe871cd76d (diff)
downloadmailutils-bec61dbdc6b638b4db03d40233c77727a7fcf692.tar.gz
mailutils-bec61dbdc6b638b4db03d40233c77727a7fcf692.tar.bz2
Adopt for the new output format of snarf_doc
-rw-r--r--scripts/guile-1.6/guile-doc-snarf.awk26
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/guile-1.6/guile-doc-snarf.awk b/scripts/guile-1.6/guile-doc-snarf.awk
index 78725c188..c59f00e66 100644
--- a/scripts/guile-1.6/guile-doc-snarf.awk
+++ b/scripts/guile-1.6/guile-doc-snarf.awk
@@ -53,16 +53,15 @@ function error(s) {
exit 1
}
-state == 0 && $1 == "{" {
- flush()
- cname = $3
- next
-}
+#{print NR ": " state}
+
+state == 0 && NF != 0 { state = 1 }
-state == 0 && /fname/ { fname = substr($2,2,length($2)-2); next }
-state == 0 && /type/ { type = $2; next }
-state == 0 && /location/ { loc_source = $2; loc_line = $3 }
-state == 0 && /arglist/ {
+state == 1 && $1 == "cname" { cname = $2; next }
+state == 1 && $1 == "fname" { fname = substr($2,2,length($2)-2); next }
+state == 1 && $1 == "type" { type = $2; next }
+state == 1 && $1 == "location" { loc_source = $2; loc_line = $3; next }
+state == 1 && $1 == "arglist" {
match($0, "\\(.*\\)")
s = substr($0,RSTART+1,RLENGTH-2)
numargs = split(s, a, ",")
@@ -80,10 +79,13 @@ state == 0 && /arglist/ {
error(cname ": wrong argument type for arg " i " " t)
arglist[i] = n
}
+ next
}
-state == 0 && /argsig/ { arg_req = $2; arg_opt = $3; arg_var = $4 }
-state == 0 && /.*\"/ {
+state == 1 && $1 == "argsig" { arg_req = $2; arg_opt = $3; arg_var = $4; next }
+state == 1 && $1 == "argpos" { argpos[$2] = $3; next }
+
+state == 1 && / *\"/ {
# Concatenate strings. A very simplified version, but
# works for us
gsub("\\\\n\" *\"", "\n")
@@ -93,7 +95,7 @@ state == 0 && /.*\"/ {
docstring = substr($0,RSTART+1,RLENGTH-2)
}
-/argpos/ { argpos[$2] = $3 }
+state == 1 && NF==0 { flush(); state = 0; }
END {
flush()

Return to:

Send suggestions and report system problems to the System administrator.