mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-01 16:35:04 +00:00
19 lines
542 B
Plaintext
19 lines
542 B
Plaintext
|
#
|
||
|
# The PROTO macro is a subterfuge to be compatible with both ANSI and K&R
|
||
|
# declaration syntax. It's not widely known, so for the docn just map the
|
||
|
# thing to ANSI declaration syntax.
|
||
|
#
|
||
|
# First, join up defns broken across multiple lines in source---but leave
|
||
|
# any linebreaks, to prettify our examples
|
||
|
:pbegn
|
||
|
/PROTO(.*, *$/N
|
||
|
s/\n/?/
|
||
|
t pbegn
|
||
|
s/?/\
|
||
|
/g
|
||
|
# Now actually do the PROTO interpretation.
|
||
|
# A PROTO invocation looks like
|
||
|
# PROTO( resulttype, function, (arglist));
|
||
|
s/[ ]*PROTO(\(.*\),[\n ]*\(.*\),[\n ]*\((.*)\));/\1 \2\3;/
|
||
|
|