User:8680/tmp/AnimationWMLProgressiveStringSquareBracketExpansionSyntax

From The Battle for Wesnoth Wiki
Revision as of 02:21, 8 February 2014 by 8680 (talk | contribs) (Created page with "Each set of square brackets (‘[’ and ‘]’) contains a comma-separated list — an '''''expansion list''''' — of which each element can be: # a plain '''string''' —...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Each set of square brackets (‘[’ and ‘]’) contains a comma-separated list — an expansion list — of which each element can be:

  1. a plain string — e.g., “abc” or “123”;
  2. a range, expressed as two radix-10 integers, separated by a tilde — e.g., “1~5”; or
  3. a repetition, notated as a string and a radix-10 integer, separated by an asterisk — e.g., “a*3”.

Ranges can not only be from a lesser number to a greater number (e.g., “1~5”), but can also be backward — from a greater number to a lesser number (e.g., “5~1”).

A single progressive string value may contain multiple expansion lists, which must all be of the same length in elements.

When a progressive string that contains expansion lists is processed to expand its expansion lists, it is transformed into a comma-separated list, which is generated as follows: