Ampersanding in files used with >allow_indent and >repeat Statements

When >allow_indent is not set (which is the default), indented specfile lines that ampersand in other files will cause an error, unless the point at which they are being used is expecting literal text.

For example, in a lines= definition, an indented spec line beginning with an ampersand will be treated as plain text unless >allow_indent is on.

When >-allow_indent is set (off), files that are ampersanded into a >repeat are read immediately and any $text strings found inside the file are treated as >repeat variables and thus expanded by the >repeat.

When >allow_indent is set (on), an ampersand file spec that is not indented is treated the same way. If the ampersand file spec is indented, the spec line will be “passed through” the >repeat. A warning is displayed indicating this is generated. Passed through means that the literal spec line &file is used in the repeat, instead of the file’s contents. For this reason, $text strings in the file will not be expanded by the >repeat because the >repeat will never “see” them.

One advantage of setting >allow_indent and indenting the &file lines is that the &file lines may contain >repeat variables to be expanded.

For example, with >allow_indent (on) the following specs are legal:

  >repeat $f=1,...,5&file$f>endrepeat


All of the files referenced by the expanded >repeat must exist or else an error will be generated. This is because the expanded file name is passed to the gens portion of the >repeat, where the named files contents will be ampersanded in to the run.