NetBSD/gnu/lib/libregex/doc/include.awk

20 lines
645 B
Awk
Raw Normal View History

1993-04-08 05:12:23 +04:00
# Assume `source' is set with -vsource=filename on the command line.
#
/^\[\[\[/ { inclusion = $2; # name of the thing to include.
printing = 0;
while ((getline line < source) > 0)
{
if (match (line, "\\[\\[\\[end " inclusion "\\]\\]\\]"))
printing = 0;
if (printing)
print line;
if (match (line,"\\[\\[\\[begin " inclusion "\\]\\]\\]"))
printing = 1;
}
close (source);
next;
}
{ print }