summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libregex/doc/include.awk
blob: a1df3f84634f7fe96ee51f113aa031f94999f820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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 }
OpenPOWER on IntegriCloud