home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / REGEX011.TAZ / REGEX011 / regex-0.11 / doc / include.awk next >
Encoding:
Text File  |  1992-01-05  |  645 b   |  20 lines

  1. # Assume `source' is set with -vsource=filename on the command line.
  2. /^\[\[\[/    { inclusion = $2; # name of the thing to include.
  3.                   printing = 0;
  4.                   while ((getline line < source) > 0)
  5.                     {
  6.                       if (match (line, "\\[\\[\\[end " inclusion "\\]\\]\\]"))
  7.                         printing = 0;
  8.  
  9.                       if (printing)
  10.                         print line;
  11.  
  12.                       if (match (line,"\\[\\[\\[begin " inclusion "\\]\\]\\]"))
  13.                         printing = 1;
  14.                     }
  15.                   close (source);
  16.           next;
  17.                 }
  18.         { print }
  19.