Basic Syntax - Mrcarrot1/KarrotObjectNotation GitHub Wiki

KON is a very simple system of representing data. All values are repesented as strings of text. For more complex datatypes, a node containing the necessary information to reconstruct the object should be stored.

KON parses line-by-line. This means that line breaks are significant characters and may not be omitted. As of KON 1.0, this rule has been relaxed. KON files may now be written without line breaks so long as semicolons ; are placed at the end of values in a node or array. Blank lines are permitted.

KON data is conventionally stored in plaintext files with the extension .kon. This is, however, not mandatory, and any file extension may be used.

KON comments are marked by the characters //. The syntax does not support multiline comments.

The general structure of a KON file is as follows:

//Every file contains one root node with any number of children
RootNode
{
    //A simple value for storing a string to be retrieved from a dictionary
    key1 = value1
    //A child node may represent a child object, set of values, etc.
    ChildNode
    {
        key1 = value1
        key2 = value2
    }
    //Arrays represent a list of values
    Array
    [
        item1
        item2
    ]
}

Inline syntax:

RootNode { key1 = value1; ChildNode { key1 = value1; key2 = value2; } Array [ item1; item2; ] }

For help with more specific syntax elements, see the individual pages on those elements.