Commit 73215147 authored by Jack Jansen's avatar Jack Jansen

Fixed bug in optional argument error checking (and generated all

suites anew).
parent a1db48b7
This diff is collapsed.
This diff is collapsed.
......@@ -25,9 +25,9 @@ class Required_Suite:
_code = 'aevt'
_subcode = 'odoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -45,9 +45,9 @@ class Required_Suite:
_code = 'aevt'
_subcode = 'pdoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -64,9 +64,9 @@ class Required_Suite:
_code = 'aevt'
_subcode = 'quit'
if _arguments: raise TypeError, 'No optional args expected'
if _no_object != None: raise TypeError, 'No direct arg expected'
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -83,9 +83,9 @@ class Required_Suite:
_code = 'aevt'
_subcode = 'oapp'
if _arguments: raise TypeError, 'No optional args expected'
if _no_object != None: raise TypeError, 'No direct arg expected'
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......
......@@ -61,9 +61,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'qobj'
aetools.keysubst(_arguments, self._argmap_class_info)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_class_info)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -88,9 +88,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'clos'
aetools.keysubst(_arguments, self._argmap_close)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_close)
aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode,
......@@ -115,9 +115,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'cnte'
aetools.keysubst(_arguments, self._argmap_count)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_count)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -141,9 +141,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'dsiz'
aetools.keysubst(_arguments, self._argmap_data_size)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_data_size)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -161,9 +161,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'delo'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -187,9 +187,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'clon'
aetools.keysubst(_arguments, self._argmap_duplicate)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_duplicate)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -213,9 +213,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'gtei'
aetools.keysubst(_arguments, self._argmap_event_info)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_event_info)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -234,9 +234,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'doex'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -265,9 +265,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'crel'
aetools.keysubst(_arguments, self._argmap_make)
if _no_object != None: raise TypeError, 'No direct arg expected'
aetools.keysubst(_arguments, self._argmap_make)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -291,9 +291,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'move'
aetools.keysubst(_arguments, self._argmap_move)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_move)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -311,9 +311,9 @@ class Standard_Suite:
_code = 'aevt'
_subcode = 'odoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -331,9 +331,9 @@ class Standard_Suite:
_code = 'aevt'
_subcode = 'pdoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -355,9 +355,9 @@ class Standard_Suite:
_code = 'aevt'
_subcode = 'quit'
aetools.keysubst(_arguments, self._argmap_quit)
if _no_object != None: raise TypeError, 'No direct arg expected'
aetools.keysubst(_arguments, self._argmap_quit)
aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode,
......@@ -383,9 +383,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'save'
aetools.keysubst(_arguments, self._argmap_save)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_save)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......@@ -409,9 +409,9 @@ class Standard_Suite:
_code = 'core'
_subcode = 'gtsi'
aetools.keysubst(_arguments, self._argmap_suite_info)
_arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_suite_info)
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
......
......@@ -311,6 +311,16 @@ def compileevent(fp, event):
#
fp.write("\t\t_code = %s\n"% `code`)
fp.write("\t\t_subcode = %s\n\n"% `subcode`)
#
# Do keyword name substitution
#
if arguments:
fp.write("\t\taetools.keysubst(_arguments, self._argmap_%s)\n"%funcname)
else:
fp.write("\t\tif _arguments: raise TypeError, 'No optional args expected'\n")
#
# Stuff required arg (if there is one) into arguments
#
if has_arg:
fp.write("\t\t_arguments['----'] = _object\n")
elif opt_arg:
......@@ -320,12 +330,8 @@ def compileevent(fp, event):
fp.write("\t\tif _no_object != None: raise TypeError, 'No direct arg expected'\n")
fp.write("\n")
#
# Do key substitution
# Do enum-name substitution
#
if arguments:
fp.write("\t\taetools.keysubst(_arguments, self._argmap_%s)\n"%funcname)
else:
fp.write("\t\tif _arguments: raise TypeError, 'No optional args expected'\n")
for a in arguments:
if is_enum(a[2]):
kname = a[1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment