Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4ffee69f
...
4ffee69f8de513f0db0e777ed195476c74c59090
authored
2006-06-15 13:30:55 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix docfile generation
1 parent
3bd03f85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
19 deletions
scripts/guile-1.6/guile-doc-snarf
scripts/guile-1.6/guile-doc-snarf.awk
scripts/guile-1.6/guile-doc-snarf
View file @
4ffee69
#! /bin/sh
# Copyright (C) 2002 Sergey Poznyakoff
# Copyright (C) 2002
, 2006
Sergey Poznyakoff
#
# This is a snarfer for guile version 1.6
#
...
...
@@ -33,7 +33,7 @@ do
-d
)
DOCFILE
=
1;
shift
;;
*
)
break
;;
esac
done
done
INFILE
=
$1
;
shift
...
...
@@ -50,15 +50,8 @@ snarf_x() {
snarf_doc
()
{
$CPP
-DSCM_MAGIC_SNARF_DOCS
"
$@
"
>
${
temp
}
cpp_exit
=
$?
$AWK
'
NF<2 {next}
state == 0 && /\^\^ {/ { state = 1; print; next }
state == 0 && /\^\^/ { print }
state == 1 && /\^\^ }/ { state = 0; print; next }
state == 1 { print }
state == 0 { next }'
$temp
|
\
tr -d
'\n'
| tr
'^'
'\n'
|
\
$AWK
-f
$BASEDIR
/guile-doc-snarf.awk >
$OUTFILE
sed -n
'/\^^ *{.*^^ *}/{s,\^^,\n,pg}'
$temp
|
\
$AWK
-f
$BASEDIR
/guile-doc-snarf.awk
}
case
"
$DOCFILE
"
in
...
...
scripts/guile-1.6/guile-doc-snarf.awk
View file @
4ffee69
# Copyright (C) 2002 Sergey Poznyakoff
# Copyright (C) 2002
, 2006
Sergey Poznyakoff
#
# This is a snarfer for guile version 1.6
#
...
...
@@ -27,11 +27,18 @@ function flush() {
if
(
arg_req
+
arg_opt
+
arg_var
!=
numargs
)
error
(
cname
" incorrectly defined as taking "
numargs
" arguments"
)
print
"
\f
"
c
name
print
"
\f
"
f
name
print
"@c snarfed from "
loc_source
":"
loc_line
printf
"@deffn {Scheme procedure} %s"
,
cname
for
(
i
=
1
;
i
<=
numargs
;
i
++
)
printf
(
" %s"
,
arglist
[
i
])
printf
"@deffn {Scheme procedure} %s"
,
fname
# All scheme primitives follow the same naming style:
# SCM argument names are in upper case.
# So, we convert them to lower case for @deffn line and
# replace their occurrences in the docstring by appropriate
# @var{} commands.
for
(
i
=
1
;
i
<=
numargs
;
i
++
)
{
printf
(
" %s"
,
tolower
(
arglist
[
i
]))
gsub
(
arglist
[
i
],
"@var{"
tolower
(
arglist
[
i
])
"}"
,
docstring
)
}
print
""
print
docstring
print
"@end deffn
\n
"
...
...
@@ -46,13 +53,13 @@ function error(s) {
exit
1
}
state
==
0
&&
/
{
/
{
state
==
0
&&
$
1
==
"{"
{
flush
()
cname
=
$
3
next
}
state
==
0
&&
/
fname
/
{
fname
=
$
2
;
next
}
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
/
{
...
...
@@ -70,13 +77,16 @@ state == 0 && /arglist/ {
n
=
b
[
2
]
}
if
(
m
>
2
||
t
!=
"SCM"
)
error
(
cname
": wrong argument type for arg "
i
" "
t
)
error
(
cname
": wrong argument type for arg "
i
" "
t
)
arglist
[
i
]
=
n
}
}
state
==
0
&&
/
argsig
/
{
arg_req
=
$
2
;
arg_opt
=
$
3
;
arg_var
=
$
4
}
state
==
0
&&
/
.
*
\
"/ {
# Concatenate strings. A very simplified version, but
# works for us
gsub("
\\\\
n
\
" *
\"
"
,
"
\n
"
)
gsub
(
"
\"\"
"
,
""
)
gsub
(
"
\\\\
n"
,
"
\n
"
)
match
(
$
0
,
"
\"
.*
\"
"
)
...
...
Please
register
or
sign in
to post a comment