mood.compiler

Undocumented in source.

Members

Functions

compile
Document compile()

* Compiles a set of nodes into a Document. * * Takes a set of parsed, and linked nodes, then turns it into an optimized webpage by creating the entrypoint function, of the app, and shortening the normal html content into as few nodes as possible. * * Params: * nodes = The webpage nodes. * Returns: Compiled Document that represents the webpage.

compileProgram
auto compileProgram()

* Creates executable program for a webpage * * Takes in a set of nodes and parameters and creates the executable function that is used to run code on a webpage * * Params: * __nodes = The nodes of the webpage itself * __params = the parameters that are passed to the webpage through the render function. * Returns: automatically deduced function that is ran on page load.

createProgram
string createProgram()

* Creates the program source for a webpage. * * Creates the source code for a webpage by taking in all the nodes of the webpage and determining if its a code section or not. * * Params: * nodes = The nodes of the webpage. * Returns: Source code of the program that is mixin'd

extendParameters
string extendParameters()

* Converts template parameters to function parameters. * * Used to convert template parameters into the function parameters that are passed to the executable function on page load. * * Params: * params = The params that are to be converted. * Returns: The resulting code from the conversion.

getImportList
string getImportList()

Returns a mixin-able import list from a list of params.

link
Node[] link()

* Resolve any includes that are in a parsed file. * * iterates over all of the parsed nodes and if there is a node that is an include tag i.e. <include:file.html/>, then it will load the file, and try and insert it into the webpage. * Note: This will fail if two or more includes rely on each other. If you get an error along the lines of too many levels of CTFE recursion, then you may have one file that includes itself. * * Params: * nodes = The nodes of the current webpage that are to be parsed over. * Returns: The resulting webpage with all includes inserted into it.

Structs

Document
struct Document

* A struct that represents a compiled webpage * * Returned by compile, and contains an entrypoint function to run all of the code that is on the webpage. Currently codeSections is unused, but in the future will be used for error checking.

Variables

outputCodeStub
string outputCodeStub;

A block of code that is inserted into the beginning of every webpage program so that it can have output functionality.

Meta