mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 08:35:21 +00:00
222 lines
4.3 KiB
INI
222 lines
4.3 KiB
INI
{./macros.cfg}
|
|
[wml_schema]
|
|
[type]
|
|
name="regex"
|
|
value=".*"
|
|
[/type]
|
|
[type]
|
|
name="glob"
|
|
value=".*"
|
|
[/type]
|
|
[type]
|
|
name="string"
|
|
value=".*"
|
|
[/type]
|
|
[type]
|
|
name="id"
|
|
value="[a-zA-Z0-9_~$]+"
|
|
[/type]
|
|
[type]
|
|
name="path"
|
|
[list]
|
|
min=1
|
|
split="/"
|
|
[element]
|
|
link="id"
|
|
[/element]
|
|
[/list]
|
|
[/type]
|
|
[type]
|
|
name="path_list"
|
|
[list]
|
|
min=1
|
|
[element]
|
|
link="path"
|
|
[/element]
|
|
[/list]
|
|
[/type]
|
|
[type]
|
|
name="id_list"
|
|
[list]
|
|
min=1
|
|
[element]
|
|
link="id"
|
|
[/element]
|
|
[/list]
|
|
[/type]
|
|
[type]
|
|
name="int"
|
|
value="\d+"
|
|
[/type]
|
|
[type]
|
|
name="inf"
|
|
value="infinite"
|
|
[/type]
|
|
[type]
|
|
name="bool"
|
|
value="yes|no|true|false"
|
|
[/type]
|
|
# Used to override a required key into an optional key with no allowed values.
|
|
# This should be used for the `name` key in certain tags where it is not allowed,
|
|
# as the schema can't override a supertag key with its absence.
|
|
[type]
|
|
name="disallowed"
|
|
value="]^"
|
|
[/type]
|
|
[tag]
|
|
name="root"
|
|
min=1
|
|
[tag]
|
|
name="wml_schema"
|
|
min=1
|
|
[tag]
|
|
name="type"
|
|
max=infinite
|
|
{REQUIRED_KEY name id}
|
|
{SIMPLE_KEY allow_translatable bool}
|
|
[if]
|
|
[union]
|
|
[/union]
|
|
[then]
|
|
[tag]
|
|
name="union"
|
|
min=1
|
|
[tag]
|
|
name="type"
|
|
max=infinite
|
|
super="wml_schema/type"
|
|
# The `name` key should not exist in a union tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[/then]
|
|
[elseif]
|
|
[intersection]
|
|
[/intersection]
|
|
[then]
|
|
[tag]
|
|
name="intersection"
|
|
min=1
|
|
[tag]
|
|
name="type"
|
|
max=infinite
|
|
super="wml_schema/type"
|
|
# The `name` key should not exist in an intersection tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[/then]
|
|
[/elseif]
|
|
[elseif]
|
|
[list]
|
|
[/list]
|
|
[then]
|
|
[tag]
|
|
name="list"
|
|
min=1
|
|
{DEFAULT_KEY min int 0}
|
|
{DEFAULT_KEY max int,inf infinite}
|
|
{DEFAULT_KEY split regex "\s*,\s*"}
|
|
[tag]
|
|
name="element"
|
|
max=infinite
|
|
super="wml_schema/type"
|
|
# The `name` key should not exist in a list/element tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[/then]
|
|
[/elseif]
|
|
[elseif]
|
|
glob_on_value=*
|
|
[then]
|
|
{SIMPLE_KEY value regex}
|
|
[/then]
|
|
[/elseif]
|
|
[else]
|
|
{SIMPLE_KEY link id}
|
|
[/else]
|
|
[/if]
|
|
[/tag]
|
|
[tag]
|
|
name="tag"
|
|
min=1
|
|
{REQUIRED_KEY name glob}
|
|
{DEFAULT_KEY min int 0}
|
|
{DEFAULT_KEY max int,inf 1}
|
|
{SIMPLE_KEY super path_list}
|
|
{DEFAULT_KEY any_tag bool no}
|
|
{DEFAULT_KEY deprecated bool no}
|
|
{DEFAULT_KEY min_tags int 0}
|
|
{DEFAULT_KEY max_tags int,inf infinite}
|
|
[tag]
|
|
name="key"
|
|
max=infinite
|
|
{REQUIRED_KEY name glob}
|
|
{REQUIRED_KEY type id_list}
|
|
{DEFAULT_KEY mandatory bool no}
|
|
{SIMPLE_KEY default string}
|
|
{DEFAULT_KEY deprecated bool no}
|
|
[/tag]
|
|
{LINK_TAG "wml_schema/tag"}
|
|
[tag]
|
|
name="link"
|
|
max=infinite
|
|
{REQUIRED_KEY name path}
|
|
[/tag]
|
|
[tag]
|
|
name="switch"
|
|
max=infinite
|
|
{REQUIRED_KEY key id}
|
|
[tag]
|
|
name="case"
|
|
max=infinite
|
|
super="wml_schema/tag"
|
|
{REQUIRED_KEY value string}
|
|
{DEFAULT_KEY trigger_if_missing bool no}
|
|
# The `name` key should not exist in a switch/case tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[tag]
|
|
name="else"
|
|
super="wml_schema/tag"
|
|
# The `name` key should not exist in a switch/else tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[tag]
|
|
name="if"
|
|
max="infinite"
|
|
any_tag=yes
|
|
{ANY_KEY string}
|
|
[tag]
|
|
name="then"
|
|
super="wml_schema/tag"
|
|
# The `name` key should not exist in an if/then tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[tag]
|
|
name="elseif"
|
|
max=infinite
|
|
any_tag=yes
|
|
{ANY_KEY string}
|
|
[tag]
|
|
name="then"
|
|
min=1
|
|
super="wml_schema/tag"
|
|
# The `name` key should not exist in an if/elseif/then tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[tag]
|
|
name="else"
|
|
super="wml_schema/tag"
|
|
# The `name` key should not exist in an if/else tag.
|
|
{SIMPLE_KEY name disallowed}
|
|
[/tag]
|
|
[/tag]
|
|
[/tag]
|
|
[/tag]
|
|
[/tag]
|
|
[/wml_schema]
|