Make wmlparser fail hard on a tag formed like [ this],
...where wesnoth's parser ignores the whitespace. Previously this was treated as a differently named tag and could cause strange errors in other places.
This commit is contained in:
parent
3002ffe6d5
commit
73bdcb5a68
1 changed files with 5 additions and 0 deletions
|
@ -789,6 +789,11 @@ class Parser:
|
|||
subdata.set_meta(self.filename, self.line)
|
||||
self.parse_top(subdata, name)
|
||||
data.insert(subdata)
|
||||
elif name[0] == " ":
|
||||
# We single this case out explicitly as the wesnoth parser
|
||||
# ignores it due to implementation reasons and this makes
|
||||
# more sense of the error message
|
||||
raise Error(self, "Invalid tag [%s] contains whitespace" % name)
|
||||
else:
|
||||
subdata = wmldata.DataSub(name)
|
||||
subdata.set_meta(self.filename, self.line)
|
||||
|
|
Loading…
Add table
Reference in a new issue