Wartbed:Files/Formats/Script

From Dark Omen Wiki

< Wartbed:Files | Formats
Revision as of 19:45, 27 November 2009 by Mikademus (Talk | contribs)
Jump to: navigation, search

Human-readable text-based mark-up language for data definitions. Script v2 is a flexible language parser that can use arbitrarily defined symbols for scoping and operators, but the WARTBED Script syntax is loosely based on C/C++ syntax. The WARTBED Script can be said to fulfil the same function as XML, but is infinitely more readable and easy to maintain.

NOTE that WARTBED currently uses Script v2, but some examples in this wiki are written in the style of v1. In the first version, name and value in pairs where separated by colon, while in v2 C-style assignment operators are used. 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.

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 the boolean keywords 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