Adds a text transform step for the aliasof attribute under
[terrain_type] accounting for several changes to base terrain aliasing
in Wesnoth 1.11.8 and 1.11.9, including:
* 10854d4802 and related commits
* c25849b7ea (Vit -> Vt in 1.11.9)
Just like usual terrain string conversions, this step can be disabled
for a specific line using # wmllint: noconvert.
Keys from the dictionary of stored units are removed as the unit is
unstored or its variable cleared. However, I found that one character in
Legend of Wesmere, Urudin, is stored but apparently never unstored/cleared.
I figure it's best to report such cases.
This message does not include helpful information like the filename,
because that data was never stored in the dictionary. The dictionary was
designed on the presumption that all entries would have a matching unstore/
clear event, and I didn't think of this warning until I saw there was an
anomalous case. Those who get this error will just have to use grep!
This required care to:
* not add ids inside [not] tags
* remove items from dictionary not just when unstored, but when
clear_variable is used
* handle comma-separated values
Sigh. Probably should re-write the .plain file parser to first remove
all commands, keeping the meta-information in a separate class. Then
parse the result (which should be much simpler) and consult the
meta-information where necessary (text-domain for strings, source files
and line numbers for tokens).
The last commit fixed one issue but introduced yet another. Now both
should work. Need to investigate if parsing the .plain files really is
necessary, would make things much easier if there was no need for it.
For example defined strings with empty lines would not work. The problem
was a direct check for newlines which failed if there were chr(254)
commands on the same line.
I actually thought this was already checked by the "unknown 'xx' referred to
by id" warning. Probably because many more [message]s used to use id= and
role= rather than speaker=.
As a side effect, this new error will force designers to use my 'who' and
'whofield' magic comments!
I am responsible for wmlscope suddenly giving macro mismatch errors, as was
pointed out on IRC. The tell is that in each of these errors, the last field
is interpreted as a stringliteral.
An argument that starts and ends with a quote is interpreted as a stringliteral.
But under previous code, that couldn't happen: quote characters toggled the
instring status on and off, but weren't added to arg, so no arg contained any
quotes. I didn't like the fact that this stripped the quotes out of translatable
strings, so I changed the code to include quotes in arg and strip them out if
they began and ended the arg. Unfortunately, while I stripped out quotes when
arg was terminated by a space, I didn't think it was necessary when the right
bracket terminated the arg. It was.
The tags are now tested directly, rather than as a parent of a key. The old
test was probably not missing tags like the test for illegal child of [if]
did, because [part] could be anywhere in ancestors. Anyway, [part] rarely
contains other tags.
Previously, only lines that parse_attribute could process got passed to
local_sanity_check. So tags survived as ancestors of attribute lines, but
the lines with the tags themselves got discarded. Hence, the "illegal child
of [if]" error was actually triggered by attributes, and the line number
referred to that line rather than the child tag.
While working on [aspect] and [facet] (which originally preceded this commit),
I changed the TypeError exception to pass all lines to local_sanity_check. This
allows for a direct test of the child tags. It turns out many child tags were
not tested because all the attributes were nested deeper inside other tags,
so that the child tag was not the parent of any attribute.
Two core macros failed the new test with the tags [filter_second] and
[filter_second_attack]. This pointed up the fact that these were not in the
list of valid child tags.
It also turns out that tags inside #ifdefs didn't fit the original test,
because "#ifdef" was considered an ancestor, interrupting the link between
"[if]" and the child tag.