Wartbed:Files/Formats/Script

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(Example)
Line 17: Line 17:
<div style="font-family: lucida console, monospace; white-space: pre; border: 1px black dashed; margin: 1em; padding: 1em;"><nowiki>first = Hello, file!
<div style="font-family: lucida console, monospace; white-space: pre; border: 1px black dashed; margin: 1em; padding: 1em;"><nowiki>first = Hello, file!
second = "  Hello, whitespace!      "
second = "  Hello, whitespace!      "
 +
" more whitespace  " =      only  ends  are  trimmed    ;
outer block
outer block

Revision as of 18:27, 17 November 2009

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.

Syntax

WARTBED Script

  • represents data as couples of names and values separated by an operator
  • supports data values of types integers, doubles, strings and booleans.
  • uses curly brackets ("{" and "}") for scopes
  • uses C's assignment operators (=, +=, -=, *= and /=) to separate name and value of data
  • supports white space in names and data without citation marks. If leading or trailing white space is required, to be retained or operators must be included in name or value, citation marks must be used
  • reads EOL as end of the current declaration. Multiple declaration 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.

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" } }
Personal tools
communication