summaryrefslogtreecommitdiff
path: root/doc/syntax-include.mdwn
blob: a95f489d336ee30cb6a1bd85df645aa28155d3be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Lace - Syntax of 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.