[m-rev.] for review: remove anachronisms from parse_module.m

Julien Fischer jfischer at opturion.com
Thu Jan 27 15:07:47 AEDT 2022


On Thu, 27 Jan 2022, Zoltan Somogyi wrote:

> Remove anachronisms from parse_module.m.
> 
> Delete a globals structure from many predicates' argument lists.
> These were needed when we switched from printing out each error immediately
> using io.write_string to constructing an error_spec and printing it out
> immediately, but have not been needed since the code to print
> the error_specs constructed here has been moved outside this module.
> The only reason why the compiler could not tell us that these arguments
> were not needed anymore is that they *were* being passed in recursive calls
> (both self-recursive and mutually recursive).
> 
> Delete two output arguments of check_for_unexpected_item_at_end that all
> of its caller ignore.
> 
> Delete the version_number_info_type. It has not been needed since we moved
> version numbers items to *before* the ':- interface' marker in interface files.
> 
> If trying to read in a version numbers item results in garbage, record
> the error but do not try to read the *next* term in the interface file
> as a version numbers item. If an automatically generated file such as
> an interface file contains an error, the entirety of that file is suspect.
> Any attempt at recovery from such errors is more likely to cause avalanche
> errors than a clean recovery.
> 
> Give two of the function symbols in the read_io_result type clearer names.
> 
> Convert more predicates to returning *either* the entity it is looking for
> *or* a description of the errors that prevent us from finding it,
> but not both.
> 
> Move the code that reads in one or both sections of an interface file
> into a predicate of its own, in order to reduce indentation levels.

That's fine.

Julien.


More information about the reviews mailing list