-
-
Notifications
You must be signed in to change notification settings - Fork 991
/
schema.cfg
210 lines (210 loc) · 3.92 KB
/
schema.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
{./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]
[tag]
name="root"
min=1
[tag]
name="wml_schema"
min=1
[tag]
name="type"
max=infinite
super="wml_schema/type"
{REQUIRED_KEY name id}
[if]
[union]
[/union]
[then]
[tag]
name="union"
min=1
[tag]
name="type"
max=infinite
super="wml_schema/type"
# Override the required name with an optional name
# Technically name is not really allowed here at all,
# but the schema can't override a supertag key with its absence.
{SIMPLE_KEY name string}
[/tag]
[/tag]
[/then]
[elseif]
[intersection]
[/intersection]
[then]
[tag]
name="intersection"
min=1
{LINK_TAG "wml_schema/type"}
[tag]
name="type"
max=infinite
super="wml_schema/type"
# Override the required name with an optional name
# Technically name is not really allowed here at all,
# but the schema can't override a supertag key with its absence.
{SIMPLE_KEY name string}
[/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"
# Override the required name with an optional name
# Technically name is not really allowed here at all,
# but the schema can't override a supertag key with its absence.
{SIMPLE_KEY name string}
[/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}
[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}
[/tag]
[tag]
name="else"
super="wml_schema/tag"
[/tag]
[/tag]
[tag]
name="if"
max="infinite"
any_tag=yes
{ANY_KEY string}
[tag]
name="then"
super="wml_schema/tag"
[/tag]
[tag]
name="elseif"
max=infinite
super="wml_schema/tag"
any_tag=yes
{ANY_KEY string}
[tag]
name="then"
min=1
super="wml_schema/tag"
[/tag]
[/tag]
[tag]
name="else"
super="wml_schema/tag"
[/tag]
[/tag]
[/tag]
[/tag]
[/tag]
[/wml_schema]