Loading

Paste #ptuojbjwz

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

Comments