home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make fullness/emptiness of bottles visible via .thing_char.
[plomrogue2]
/
plomrogue
/
parser.py
diff --git
a/plomrogue/parser.py
b/plomrogue/parser.py
index d1307a97701d3ef5c5eee6ecc2c16cfcb8d94282..69f728ee9859f3ed299f04b98177687c0ee52ce0 100644
(file)
--- a/
plomrogue/parser.py
+++ b/
plomrogue/parser.py
@@
-1,4
+1,3
@@
-import unittest
from plomrogue.errors import ArgError
from plomrogue.mapping import YX
from plomrogue.errors import ArgError
from plomrogue.mapping import YX
@@
-102,8
+101,8
@@
class Parser:
tmpl_tokens = signature.split()
if len(tmpl_tokens) != len(args_tokens):
raise ArgError('Number of arguments (' + str(len(args_tokens)) +
tmpl_tokens = signature.split()
if len(tmpl_tokens) != len(args_tokens):
raise ArgError('Number of arguments (' + str(len(args_tokens)) +
- ') not expected number (' + str(len(tmpl_tokens))
-
+
').')
+ ') not expected number (' + str(len(tmpl_tokens))
+
+ ').')
args = []
string_string = 'string'
for i in range(len(tmpl_tokens)):
args = []
string_string = 'string'
for i in range(len(tmpl_tokens)):
@@
-117,6
+116,10
@@
class Parser:
if not arg.isdigit() or int(arg) < 1:
raise ArgError('Argument must be positive integer.')
args += [int(arg)]
if not arg.isdigit() or int(arg) < 1:
raise ArgError('Argument must be positive integer.')
args += [int(arg)]
+ elif tmpl == 'bool':
+ if not arg.isdigit() or int(arg) not in (0, 1):
+ raise ArgError('Argument must be 0 or 1.')
+ args += [bool(int(arg))]
elif tmpl == 'char':
try:
ord(arg)
elif tmpl == 'char':
try:
ord(arg)