Kaydet (Commit) 73215147 authored tarafından Jack Jansen's avatar Jack Jansen

Fixed bug in optional argument error checking (and generated all

suites anew).
üst a1db48b7
...@@ -25,9 +25,9 @@ class Required_Suite: ...@@ -25,9 +25,9 @@ class Required_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'odoc' _subcode = 'odoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -45,9 +45,9 @@ class Required_Suite: ...@@ -45,9 +45,9 @@ class Required_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'pdoc' _subcode = 'pdoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -64,9 +64,9 @@ class Required_Suite: ...@@ -64,9 +64,9 @@ class Required_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'quit' _subcode = 'quit'
if _arguments: raise TypeError, 'No optional args expected'
if _no_object != None: raise TypeError, 'No direct arg 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, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -83,9 +83,9 @@ class Required_Suite: ...@@ -83,9 +83,9 @@ class Required_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'oapp' _subcode = 'oapp'
if _arguments: raise TypeError, 'No optional args expected'
if _no_object != None: raise TypeError, 'No direct arg 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, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
......
...@@ -61,9 +61,9 @@ class Standard_Suite: ...@@ -61,9 +61,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'qobj' _subcode = 'qobj'
aetools.keysubst(_arguments, self._argmap_class_info)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_class_info)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -88,9 +88,9 @@ class Standard_Suite: ...@@ -88,9 +88,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'clos' _subcode = 'clos'
aetools.keysubst(_arguments, self._argmap_close)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_close)
aetools.enumsubst(_arguments, 'savo', _Enum_savo) aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
...@@ -115,9 +115,9 @@ class Standard_Suite: ...@@ -115,9 +115,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'cnte' _subcode = 'cnte'
aetools.keysubst(_arguments, self._argmap_count)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_count)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -141,9 +141,9 @@ class Standard_Suite: ...@@ -141,9 +141,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'dsiz' _subcode = 'dsiz'
aetools.keysubst(_arguments, self._argmap_data_size)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_data_size)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -161,9 +161,9 @@ class Standard_Suite: ...@@ -161,9 +161,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'delo' _subcode = 'delo'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -187,9 +187,9 @@ class Standard_Suite: ...@@ -187,9 +187,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'clon' _subcode = 'clon'
aetools.keysubst(_arguments, self._argmap_duplicate)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_duplicate)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -213,9 +213,9 @@ class Standard_Suite: ...@@ -213,9 +213,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'gtei' _subcode = 'gtei'
aetools.keysubst(_arguments, self._argmap_event_info)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_event_info)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -234,9 +234,9 @@ class Standard_Suite: ...@@ -234,9 +234,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'doex' _subcode = 'doex'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -265,9 +265,9 @@ class Standard_Suite: ...@@ -265,9 +265,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'crel' _subcode = 'crel'
aetools.keysubst(_arguments, self._argmap_make)
if _no_object != None: raise TypeError, 'No direct arg expected' if _no_object != None: raise TypeError, 'No direct arg expected'
aetools.keysubst(_arguments, self._argmap_make)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -291,9 +291,9 @@ class Standard_Suite: ...@@ -291,9 +291,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'move' _subcode = 'move'
aetools.keysubst(_arguments, self._argmap_move)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_move)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -311,9 +311,9 @@ class Standard_Suite: ...@@ -311,9 +311,9 @@ class Standard_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'odoc' _subcode = 'odoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -331,9 +331,9 @@ class Standard_Suite: ...@@ -331,9 +331,9 @@ class Standard_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'pdoc' _subcode = 'pdoc'
if _arguments: raise TypeError, 'No optional args expected'
_arguments['----'] = _object _arguments['----'] = _object
if _arguments: raise TypeError, 'No optional args expected'
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -355,9 +355,9 @@ class Standard_Suite: ...@@ -355,9 +355,9 @@ class Standard_Suite:
_code = 'aevt' _code = 'aevt'
_subcode = 'quit' _subcode = 'quit'
aetools.keysubst(_arguments, self._argmap_quit)
if _no_object != None: raise TypeError, 'No direct arg expected' if _no_object != None: raise TypeError, 'No direct arg expected'
aetools.keysubst(_arguments, self._argmap_quit)
aetools.enumsubst(_arguments, 'savo', _Enum_savo) aetools.enumsubst(_arguments, 'savo', _Enum_savo)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
...@@ -383,9 +383,9 @@ class Standard_Suite: ...@@ -383,9 +383,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'save' _subcode = 'save'
aetools.keysubst(_arguments, self._argmap_save)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_save)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
...@@ -409,9 +409,9 @@ class Standard_Suite: ...@@ -409,9 +409,9 @@ class Standard_Suite:
_code = 'core' _code = 'core'
_subcode = 'gtsi' _subcode = 'gtsi'
aetools.keysubst(_arguments, self._argmap_suite_info)
_arguments['----'] = _object _arguments['----'] = _object
aetools.keysubst(_arguments, self._argmap_suite_info)
_reply, _arguments, _attributes = self.send(_code, _subcode, _reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes) _arguments, _attributes)
......
...@@ -311,6 +311,16 @@ def compileevent(fp, event): ...@@ -311,6 +311,16 @@ def compileevent(fp, event):
# #
fp.write("\t\t_code = %s\n"% `code`) fp.write("\t\t_code = %s\n"% `code`)
fp.write("\t\t_subcode = %s\n\n"% `subcode`) 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: if has_arg:
fp.write("\t\t_arguments['----'] = _object\n") fp.write("\t\t_arguments['----'] = _object\n")
elif opt_arg: elif opt_arg:
...@@ -320,12 +330,8 @@ def compileevent(fp, event): ...@@ -320,12 +330,8 @@ def compileevent(fp, event):
fp.write("\t\tif _no_object != None: raise TypeError, 'No direct arg expected'\n") fp.write("\t\tif _no_object != None: raise TypeError, 'No direct arg expected'\n")
fp.write("\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: for a in arguments:
if is_enum(a[2]): if is_enum(a[2]):
kname = a[1] 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