Skip to main content

Consumer API

The consumer-facing API has been kept as concise and convenient as humanly possible, in order to be easily integrateable into whichever approach to managing configuration-files as well as various other day-to-day surroundings the developer at hand may have chosen.

Parsing the AST

In order to parse an input-string into an AST, the only parameter required is a reference to the tag-registry being used; in the majority of cases, the built-in instance will suffice, allowing for quick and easy access:

Code-Blocks are only available within the browser

In general, errors are only thrown during the parsing-stage, with all errors being unified under the Code-Blocks are only available within the browser, which is also able to generate a nicely formatted error-screen, for example:

Code-Blocks are only available within the browser

Next to the above, there are also many dozens of error-type enumeration-constants all throughout the system, stemming from stages like the CML event-parser as well as the expression tokenizer/parser; these are subject to change and not considered stable API, which is why next to this mention, they will not be documented.

Interpreting the AST

Once an input has been successfully parsed, its result as well as all calls to the interpreter are now safe - they will never throw at runtime and instead simply log errors to the console, which are handled as gracefully as possible, as to not bring down whatever relied on receiving an output to render.

Code-Blocks are only available within the browser

Logging Errors

Since runtime-errors are handled gracefully, logging is an integral part of this system; thus, the internally widely-used Code-Blocks are only available within the browser has been introduced, which allows the user to provide a reference of their own at any point in time:

Code-Blocks are only available within the browser