It is now roughly a superset of Pango and supports the following new features
* XML character entities, including decimal and hex entities, common named entities (apos, quot, lt, gt, amp), and even unrecognized named entities
* Nesting tags within each other (new-style only)
* Attributes without a value
Adds a test with a schema example containing a super cycle and a .cfg file containing an unknown key to this schema. Previously, this would cause an infinite loop or crash. Now an exception for invalid key should be thrown.
Add test for the already existing validation where a tag shouldn't set itself as its own super.
Add test for the new cycle detection when validating a schema.
Adds support for using these in the weapons and ability filters:
* "-1", which was previously treated as an parse error (no number before the separator).
* "-3--1"
* "-infinity" as the lower number in the range, provided a different upper number is given.
This treats "-infinity" (with no other number), "-infinity--infinity",
"infinity" (with no other number) and "infinity-infinity" as errors. It seems
unlikely that someone would intend to use a filter that can't match any
reasonable number.
The range "-infinity-infinity" will be parsed successfully. I don't see a use
case for that, but nor do I see a reason to add extra C++ to reject it.
However, it's not added to the schema, as I think it's good for the schema to
give a warning when someone creates a filter which will accept every value
(including accepting the default, so "-infinity-infinity" accepts the unset
value too).
Includes new unit tests for the C++ and the Lua stringx.parse_range functions.
The next commit adds more WML tests, but is kept separate to credit the author.
This started as a change to move common filter functions from unit.cpp to
somewhere that they could be reused for other config-based filters. In the
process a missing feature was found and added, the move is still included in a
single Git commit because the move was required in order to make these
functions accessible to the Boost unit tests.
Two CodeBlocks project files additionally get src/utils/any.hpp added,
which was in one of them but missing from the other two. I noticed because
these are alphabetically at the start of the src/utils file list.
Thanks to @CelticMinstrel for the review comments and Xcode project updates.
This commit adds tools to test parsing of WML macros by the preprocessor
and parser. The commit also adds two tests of the #define and #undef
WML macro as examples.
The tests consist of three steps:
1. Define one WML string containing macros and one WML string
that lacks macros in each test. The two WML strings should be
equivalent after preprocessing.
2. Transform each WML string into a syntax tree (represented by config
objects) with the preprocessor and parser of Wesnoth.
3. Check if the two config objects are equal. Since the two WML strings
are equivalent, the two configs object should be equivalent if the
preprocessor and parsers are both correct.
The output of the preprocessor is in an undocumented format. Therefore,
this commit does not test the preprocessor as an isolated unit.
These were emptied out when SDL 1.2 was removed (358bd1235f07d8d577). I seem to recall
someone saying it might be worth keeping them around in case something needed to be put
back, but it's been a year and a half. Not much worth in keeping empty files.
This quells warnings from CMake about reserved target names, and reduces confusion about which `test` is intended: the wesnoth executable or the standard shell command.