# HG changeset patch # User Paul Boddie # Date 1258929244 -3600 # Node ID 20a391cab5baae0a19e8b96333f6725218578bdb # Parent 499cf7a39015cec86c7ab7fdeff8ca279bdbc2d4 Regenerate the object and parameter tables after the program objects have been rebuilt. In the test program, acquire the object and parameter tables after a program has been generated. diff -r 499cf7a39015 -r 20a391cab5ba micropython/__init__.py --- a/micropython/__init__.py Sun Nov 22 22:53:24 2009 +0100 +++ b/micropython/__init__.py Sun Nov 22 23:34:04 2009 +0100 @@ -100,11 +100,10 @@ # Optimise and regenerate the object table. self.importer.vacuum(objtable) - objtable = self.get_object_table(reset=1) + self.importer.finalise() - # Finalise the importer. - - self.importer.finalise() + objtable = self.get_object_table(reset=1) + paramtable = self.get_parameter_table(reset=1) self.code = [] @@ -282,15 +281,13 @@ return self.objtable - def get_parameter_table(self): + def get_parameter_table(self, reset=0): "Return a table with details of parameters for functions and methods." # Need the object table to get at class details. - objtable = self.get_object_table() - - if self.paramtable is None: + if self.paramtable is None or reset: t = self.paramtable = micropython.table.ParameterTable() # Visit each module, getting function and method details. diff -r 499cf7a39015 -r 20a391cab5ba test.py --- a/test.py Sun Nov 22 22:53:24 2009 +0100 +++ b/test.py Sun Nov 22 23:34:04 2009 +0100 @@ -49,15 +49,15 @@ # Build the program. - ot = p.get_object_table() - pt = p.get_parameter_table() - if "-m" in args or "-t" in args: rm = rsvp.machine(p, debug=("-g" in args), abort_upon_exception=("-x" in args)) if "-t" in args: success = rm.test(m) print "Test successful?", success + ot = p.get_object_table() + pt = p.get_parameter_table() + # Report any errors. except micropython.ProcessingError, exc: