X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=new2%2Fplomrogue%2Fparser.py;h=f23a7aaacb58e8f89604f85ec1b525e0e0ac9d01;hb=47d047c10bacf2463f48aec3e7f3cc3b92a78198;hp=a56b5d1bb64bd8b07f2aecb101d88a4dc4ee91f3;hpb=51bd8dbd1de6f513fdaffa65732314b7356a1680;p=plomrogue2-experiments diff --git a/new2/plomrogue/parser.py b/new2/plomrogue/parser.py index a56b5d1..f23a7aa 100644 --- a/new2/plomrogue/parser.py +++ b/new2/plomrogue/parser.py @@ -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'):