home · contact · privacy
Add basic save file mechanism.
[plomrogue2-experiments] / new2 / plomrogue / parser.py
index a56b5d1bb64bd8b07f2aecb101d88a4dc4ee91f3..f23a7aaacb58e8f89604f85ec1b525e0e0ac9d01 100644 (file)
@@ -75,7 +75,11 @@ class Parser:
         for i in range(len(tmpl_tokens)):
             tmpl = tmpl_tokens[i]
             arg = args_tokens[i]
-            if tmpl == string_string:
+            if tmpl == 'int:nonneg':
+                if not arg.isdigit():
+                    raise ArgError('Argument must be non-negative integer.')
+                args += [int(arg)]
+            elif tmpl == string_string:
                 args += [arg]
             elif tmpl[:len(string_string) + 1] == string_string + ':':
                 if not hasattr(self.game, 'get_string_options'):