INCLUDE
statement.Developing
is true. If that variable is false, all texts between the --#IF
and --#ENDIF
are treated as comments (ignored)INCLUDE
statements, e.g. as follows:--#
preprocessor directive. When a variable name is preceeded with a !
-character, its value is cleared (set to 'false'). Otherwise, its value is set (to 'true').-
characters, (nu is dat 2 -
chars) (c) is followed by optional whitespace, (dat mag nu nog niet) (d) is followed by #
and (e) is followed with optional whitespace, is not interpreted by the Ampersand parser, but is passed to the Preprocessor instead. The text behind the #
-character up till the end of the line is the TextToBePreprocessed
. TextToBePreprocessed
is defined by the (PCRE) regex ^\s*--+\s*#\s*(?P<TextToBePreprocessed>.*)$
. Note that Ampersand versions that do not support preprocessing will treat such texts as comment.TextToBePreprocessed
. Keyword
is defined by the (PCRE) regex (?P<Keyword>\w+\b)
when it is applied to TextToBePreprocessed
. In absolute terms, that would be ^\s*--+\s*#\s*(?P<Keyword>\w+\b).*$
followed by optional whitespace and keyword consisting of alphanumeric characters. Keywords are (thus) case sensitive. Examples: --#IF Debugging
or -- # ENDIF
TextToBePreprocessed
):IF
, IFNOT
each take one argument - a variable.(?P<Keyword>IF|IFNOT)\s+(?P<Variable>\w+)
.--#IF Debugging
or --#IFNOT UserSpecifiesLoginMethod
ELSE
and ENDIF
do not take arguments.INCLUDE
statements is extended to include an optional comment that specifies a list of quoted variable names. Example INCLUDE "../SIAMv3/Login.ifc" --# [ "Debugging", "NoLogout" ]
. The (PCRE) regex is \bINCLUDE\s+"(?P<fileid>[^"]+)"(\s+(--#\s*)?\[\s*"(?P<var1>!?\w+)"(\s*,\s*"(?P<var2>!?\w+)")*\])?
where any text in groups var1
or var2
are variable names that may (optionally) be preceeded with a !
character. For each such variable names, a variable is created that can be referenced by its name. When the variable name was preceeded with a !
character, its value is initialized as 'false'; When the variable name was not preceeded with a !
character, its value is initialized as 'true'; If a variable with a specified name was already created, the newly created variable takes precedence. After a file inclusion terminates, the variables that the INCLUDE statement created are all destroyed.INCLUDE
d, preprocessor commands that evaluate a variable (such as IF
or IFNOT
) will use the value as defined in that INCLUDE
statement or (recursively) in that of a 'higher' INCLUDE
statement.