Module lace.compiler
The compiler for the Lua Access Control engine.
Lace works hard to give you good error message information when encountering problems with your rulesets. The compiler gathers a lot of debug information and stores it alongside the compiled ruleset.
Functions
internal_loader (ctx) | Internal loader abstraction. |
internal_compile (compcontext, sourcename, content, suppress_default) | Internal ruleset compilation. |
compile (ctx, src, cnt) | Compile a lace ruleset. |
Functions
- internal_loader (ctx)
-
Internal loader abstraction.
Used by
lace.builtin.commands.include
, this function returns a loader which can be used to acquire more content during compilation of a Lace ruleset.Parameters:
- ctx table The Lace compiliation context
Returns:
-
function
A loader function
- internal_compile (compcontext, sourcename, content, suppress_default)
-
Internal ruleset compilation.
Internal ruleset compilation function. This function should not be used except from compilation commands such as
lace.builtin.commands.include
. This function is much less forgiving of issues than lace.compiler.compile.Parameters:
- compcontext table Compilation context
- sourcename string Source name
- content string Source content
- suppress_default boolean Suppress the use of a default rule.
Returns:
-
table
Compiled Lace ruleset
- compile (ctx, src, cnt)
-
Compile a lace ruleset.
Compile a lace ruleset so that it can be executed by lace.engine.run later. If you provide content then it is compiled using the source name as the name used in error messages. If you do not supply any content then Lace will construct an implicit include of the given source name.
Parameters:
- ctx table Compilation context
- src string Source name
- cnt optional string Source contents (nil to cause an implicit include of src)
Returns:
-
table
Compiled Lace ruleset