diff -r 4436a5648954 nml/grfstrings.py
--- a/nml/grfstrings.py Sat Aug 23 21:31:10 2014 +0200
+++ b/nml/grfstrings.py Tue Sep 02 23:09:02 2014 +0200
@@ -13,7 +13,7 @@
with NML; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."""
-import os, codecs, glob
+import os, codecs, glob, re
from nml import generic
def utf8_get_size(char):
@@ -1080,6 +1080,9 @@
"""
_type, string, case, value = data
+ if not re.match("[A-Z_0-9]+$", string):
+ raise generic.ScriptError("Invalid string name \"{}\"".format(string), pos)
+
if string in self.strings and case is None:
raise generic.ScriptError("String name \"{}\" is used multiple times".format(string), pos)