Commit graph

11 commits

Author SHA1 Message Date
Celtic Minstrel
5a1491a6ae Split up the GUI2 schema into multiple files.
The motivation for this is to reuse parts of it for another schema.
2023-05-02 21:04:41 -04:00
Celtic Minstrel
0c42cdc038
Enable translation mark validation by the schema (#5800)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.

A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)

Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.

An optionally-translatable string could also be defined as a union of t_string and some other type.
2021-06-14 23:59:52 -04:00
Celtic Minstrel
df4413ae66 Schema: Move list types into a separate config file 2018-11-04 18:37:51 -05:00
Celtic Minstrel
52c4dc0e3d Add a validator subclass specialized for validating WML schemas against the WML schema schema 2018-11-03 17:09:25 -04:00
Celtic Minstrel
d080c69356 Schema: Fix a few more cases of keys and tags not accepting variable substitution 2018-10-23 22:41:57 -04:00
Celtic Minstrel
a1ecf1a559 First batch of schema fixes
- Allow for variable substitution in filter tags (mostly)
- Fix real not matching numbers like .5
- Support x,y=recall,recall

After this commit, there are no schema errors in the tutorial.
2018-10-23 22:38:20 -04:00
Celtic Minstrel
24608d0632 Schema ActionWML: Small bugfixes and add undocumented stuff from perusing source code 2018-10-23 22:38:16 -04:00
Celtic Minstrel
1e33a66661 Schema: Pango formatting keys for [message] 2018-10-23 22:37:46 -04:00
Celtic Minstrel
7ab5fabbf2 Schema: Add all known ActionWML and ConditionalWML tags (based on wiki)
This also finishes up the StoryWML definition, adds validation for
map and shroud data, and a few other small schema fixes
2018-10-23 22:37:44 -04:00
Celtic Minstrel
34604fdff6 Get game config and schema to use some common types
This also fixes an invalid type issue in the GUI2 schema,
and allows types to be a direct alias for other types.
2018-10-23 22:36:47 -04:00
Celtic Minstrel
3a65a14bcb Implement validation of the core game config WML
Currently this is disabled by default
Use --validate command-line argument to enable

The following new features were added in the schema format:
* Union, intersection, and list types
* Keys can specify a union of known types on-the-fly
* Key and tag names can include wildcards (* and ?, glob-style)
* Tags support any_key=yes, which means unrecognized subtags will be ignored
* Tags and keys support deprecated=yes (unimplemented)
* Specify max=infinite instead of max=-1
2018-10-23 22:36:40 -04:00