2.2 Include statements
Include statements take a source token to include and an optional list of definitions which must all be true before the include will take place.
include <sourcename> <0-or-more-definitions>
If the include ends with a question mark (include?
) then should the
sourcename not be available at the time, it will be silently ignored.
Nominally an included ruleset is linearly inserted into the execution stream
there and then. In practice, while include statements result in compilation of
the rulesets at the same time, the contents of the ruleset will not be run
unless the supplied definitions all pass. This means that any rules (including
define
s) in the included ruleset will not be executed unless the definitions
all pass. As such, use conditional includes carefully.
If an "optional" include source isn't available, it is as though the definitions did not pass. If a mandatory include source isn't available then compilation of the ruleset will fail immediately.
Circular includes are not acceptable. Not even if there's a set of conditions which mean that it might never happen. Any attempt at circular includes will result in a critical error at compile time because that is when all included rulesets are loaded in their entirety.