Wartbed:Files/Formats/Script

From Dark Omen Wiki

< Wartbed:Files | Formats(Redirected from Wartbed:Script)
Jump to: navigation, search
Other languages of similar
purpose as WARTBED Script:

Boot::ptree's INFO
YAML

JSON

WARTBED Script (a.k.a WARTS, or simply Script) is a human-readable text-based mark-up language data format used by WARTBED for data definitions. The WARTBED Script can be said to fulfil the same function as XML, but is infinitely more readable and easy to maintain.

Though the Script parser is language-agnostic (a meta-parser, or parser-engine) and can be set to interpret many languages and can use arbitrarily defined symbols for scoping and operators, Script in WARTBED is a nested-bracers language loosely based on C/C++ syntax featuring nested scopes, block and line comments, and block and items having names, operators and values. Items are delimited by new lines or semicolon, and whitespace are legal characters inside strings, but will be trimmed. To keep leading or following whitespace in names or values citation marks (quotes) must be used.

Historical note WARTBED currently uses Script v2, but some examples in this wiki are written in the style of Script v1. In the first version, name and value in pairs where separated by colon, required items to be terminated with semicolon, and did not allow blocks to have separators and values, while in v2 C-style assignment operators are used, items can be separated with newlines, and blocks can have values. For reference, while both Script versions are structurally very similar to the Boost::ptree's INFO format, Script v1 is syntactically and appearance-wise loosely comparable to the JSON format.
Usage note No WARTBED Script files have a .warts (or .script) extension even though this could be considered the default extension name; instead files will have an extension reflecting their usage or content, f.i. .module or .model.

Syntax

WARTBED Script

  • represents data as names/values pairs separated by an operator
  • supports data values of types integers, doubles, strings and booleans.
  • supports UNICODE (which doesn't mean that the in-game typeface will be able to render every glyph in the full specification, though)
  • uses curly brackets ("{" and "}") for scopes
  • uses C's assignment operators (=, +=, -=, *= and /=) to separate a datum's name and value
  • supports whitespace in names and data without citation marks. Trailing and leading whitespace is trimmed, so citation marks must be used if these are significant or if the operator strings must be included in names or values
  • reads EOL as end of the current declaration. Multiple declarations on the same line must be separated with semi-colon.
  • uses // and /* ... */ for single-line and block comments.
  • when parsing values as booleans accepts the words "true", "yes" and "on" for true, and "false", "no" and "off" for false.
  • is agnostic to character casing: all casing will be retained, but concerning boolean keywords or f.i. locating names the script parser is case-insensitive

Example

first = Hello, file! second = " Hello, whitespace! " " more whitespace " = only ends are trimmed ; outer block { 1st value += 10 2nd value -= 3.1415 option1 *= false option2a /= yes; option2b = off; inner block {name 1=WARTBED;name 2="Script"} }

Editor Integration: Syntax Highlighting

Colour highlighting for WARTBED Scripts is now supported in UltraEdit.
Download the UltraEdit .uew language file here

Personal tools
communication