FLL - Specifications - IKI-0002 (Simple Script)
Author: Kevin Day
Description: Featurless Linux Library Specifications
Keywords: Featureless, FLL, Kevin Day, Kevux, Linux, Library, Distribution, Open-Source, specification, standard, iki-0002, simple script

# Featureless Linux Library Specification

## IKI-0002 (Simple Script)

The version date of this specification is `2023/07/14`.

This specification provides a small set of vocabulary names meant to be used for substitution in simple scripts.

This specification only loosely defines the vocabulary context. This vocabulary may be further extended but must at least support the taxonomy defined here. Flexibility on interpretation is intended so that the context can be more fine-tuned and customized.

The taxonomy for the context, define, and parameter are intentionally not defined here and left open. One utilizing this should document the taxonomy for each of these as desired.

Vocabulary:

context
  Intended to be used for printing (or tagging) context codes before and after text, such as with color context.
define
  Intended to be used for global properties, much like a C/C++ `#define`.
parameter
  Intended to be used for parameters or variables.

## Common Specification Rules

IKI is a minimally structured WIKI-like syntax meant to be simpler than WIKI syntax.

The IKI syntax describes a Variable that is defined by a Vocabulary name followed by quoted value called the Content.

The Variable refers to the Vocabulary, Content, and associated syntax that describes the Variable. The Variable name may be wrapped by a single open bracket, `[` (`U+005B`), at the start and a single close bracket, `]` (`U+005D`), at the end. The open and close brackets, also called the wrapping characters, for the Variable do not utilize escaping characters and instead any escaping is perform against the colon `:` (`U+003A`) that separates the Vocabulary from the Content. The Vocabulary generally defines the context and many of the IKI specifications may provide a discrete set of allowed Vocabulary. The Vocabulary may also be referred to as the Object. The Vocabulary only allows word characters or one of `_` (`U+005F`), `-` (`U+002D`), `+` (`U+002B`), `[` (`U+005B`)). White space, non-word, and non `_` (`U+005F`), `-` (`U+002D`), `+` (`U+002B`)) character punctuation may not exist as part of the variable name. The only Unicode dash-like characters allowed as a "dash" are those intended to connect, such as the Unicode hyphens (`U+2010` and `U+2011`). Unicode punctuation connector characters are supported just like `_`, except when they connect outside the current line (such as `U+FE33` `︳`). The immediate left of a Vocabulary must not be a valid Vocabulary character, unless the Vocabulary is wrapped using the wrapping characters. Unicode invisible punctuation (such as invisible plus: `U+2064`) are not considered a punctuation in this standard (because they a zero-width characters), therefore they are not to be considered a valid `_` (`U+005F`), `-` (`U+002D`), or `+` (`U+002B`) Unicode equivalents.

The wrapping characters characters are not part of the Vocabulary name and instead only provide the syntax used to help identify a valid Variable. The wrapping characters characters are part of the Variable. The wrapping characters do not support escaping. Both wrapping characters must be specified or neither.

The Content refers to the value of the Variable. The Content is wrapped one of the following quote characters: single quote `'` (`U+0027`), double quote `"` (`U+0022`), or grave ``` (`U+0060`). The Content must escape any quotes that match the open and close quote used for the Variable by utilizing a backslash `\` (`U+005C`). If a matching closing quote is not found until the end of the data (or file), then this unclosed Variable is considered invalid. The handling of this erroneous case is left to the implementation.

The backslashes used for escaping quotes use `\` (`U+005C`). Unless otherwise specified, these backslash escapes are performed only when required and not unilaterally. One backslash escapes the valid quote, resulting in the quote being part of the Content. Two backslashes escape the backslash, resulting in the backslash (but not the quote) being part of the Content. An odd number of backslashes before a valid quote results in the backslashes and the quote being escaped. An even number of backslashes before a valid quote results in the backslashes but not the quote being escaped.

The IKI format will use `iki-0000` to represent an IKI with no explicitly defined vocabulary. Whereas `iki-0001` and beyond represent a specific IKI vocabulary.

Key:

- `\o` = any printable word character, including `_` (`U+005F`), `-` (`U+002D`), `+` (`U+002B`) (and Unicode equivalents).
- `\c` = any character, including white space and non-printing, and any escaped quote (used as the opening quote) or a any quote (unescaped) not used as the opening quote.
- `\q` = either a single quote `'` (`U+0027`), a double quote `"` (`U+0022`), or a grave ``` (`U+0060`).
- `\x` = any character.
- `\W` = any non-word character, discluding `_` (`U+005F`) (and Unicode equivalents), `-` (`U+002D`) (and Unicode equivalents), and `+` (`U+002B`) (and Unicode equivalents).
- `\e` = an optional escape sequence of any number of backslashes, such as `\` (`U+005C`).
- `[` = a single (conditionally optional) open bracket, `[` (`U+005B`).
- `]` = a single (conditionally optional) close bracket, `]` (`U+005D`).
- `*` = zero or more occurrences.
- `~` = one or more occurrences, or zero if at start of file.
- `+` = one or more occurrences.
- `:` = The colon `:` (`U+003A`).

Before Structure:

- `\x*\W~`

Structure:

- `[\o+]\e:\q\c\q`

After Structure:

- ``

Example File:

    # fss-000c iki-0000

    This is my sentence, anything can go here but sometimes I want to italic:"emphasize some text".

    Other times I want to render a URL such as this example URL: url:'http://www.example.com/url with space/'.

    There are no comments, except for maybe the FSS:"Featureless Settings Specification" header (which would not resolve to any IKI syntax anyway).

    Quotes may be included, such as: code:"const char *string = \"My \\\"quoted\\\" C string.\";".

    The following italic\:"is escaped to not be treated as IKI Variable".

    The conditionally optional open and close brackets allow for putting a variable directly next to another word character like: [context]:"bold"this[context]:"bold".

    These are examples of escapes: one:"\" escape", two:"\\" escape", three:"\\\" escape", six:"\\\\\\" escape".

    These are examples of non-escapes: one:"\' escape", two:"\\' escape", three:"\\\' escape", six:"\\\\\\' escape".

    These slashes \ \\ \\\ are not escaped because there is now quote immediately after each of them.

Example Results:

    Objects (also called vocabulary or variable name) would be:
       1.1) italic
       2.1) URL
       3.1) FSS
       4.1) code
       5.1) context
       6.1) context
       7.1) one
       8.1) two
       9.1) three
      10.1) six
      11.1) one
      12.1) two
      13.1) three
      14.1) six

    Contents (also called variable value) would be:
       1.1) emphasize some text
       2.1) http://www.example.com/url with space/
       3.1) Featureless Settings Specification
       4.1) const char *string = "My \"quoted\" C string.";
       5.1) bold
       6.1) bold
       7.1) " escape
       8.1) \
       9.1) \" escape
      10.1) \\\
      11.1) \' escape
      12.1) \\' escape
      13.1) \\\' escape
      14.1) \\\\\\' escape