gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] doc patch


From: Thien-Thi Nguyen
Subject: Re: [gnugo-devel] doc patch
Date: Thu, 06 Dec 2007 11:06:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

please find below a gtp-commands.sed that doesn't include
embedded newlines.  it uses the sequence "\n", instead.

seems to work fine w/ GNU sed.  how about BSD sed?
if so, i think we can close the issue once it is committed.

thi

________________________________________________________________
# gtp-commands.sed (edit in -*-shell-script-*- mode)
# Author: Thien-Thi Nguyen <address@hidden>

# Look for function headers.
/\* Function: /,/^{/!d

# Remove cruft.
/^static int/d
/^{/d
/^ \*\//d
s/(char.*)//g

# Hold comment lines, deleting them from pattern space for now.
/.\*/{
 s/^..//
 s/^ //
 H
 d
}

# When we see the function name, merge hold space, in the process
# generating proper texinfo @cindex, @item and @example formatting.
# As a bonus, the `Function' field is moved to the @item line.
# We use repeated `x' commands instead of the simpler `i' to avoid
# requiring a `d' (which would render this script non-composable).
/^gtp_/{
 s/\(.*\)/@cindex \1 GTP address@hidden \1/
 x
 s/^\(.\)Function: *\(.*\)\(Arguments:\)/: address@hidden/
 s/\n *\(address@hidden)/ \1/g
 s/$/address@hidden example/
 H
 s/.*//
 x
 s/\n//2
}

# gtp-commands.sed ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]