[m-rev.] for review: fix the invalid/func_class test case
Paul Bone
paul at bone.id.au
Thu Sep 10 18:30:23 AEST 2015
On Thu, Sep 10, 2015 at 08:10:23AM +1000, Zoltan Somogyi wrote:
> For review by anyone.
>
> diff --git a/compiler/error_util.m b/compiler/error_util.m
> index 484778b..1983097 100644
> --- a/compiler/error_util.m
> +++ b/compiler/error_util.m
> @@ -1,4 +1,4 @@
> -%-----------------------------------------------------------------------------%
> +%-----------------------------------------------------------------------------r
> % vim: ft=mercury ts=4 sw=4 et
> %-----------------------------------------------------------------------------%
Weird letter 'r' at the end of that line.
> @@ -723,10 +725,113 @@ get_maybe_mode_report_control(phase_code_gen) = no.
>
> %-----------------------------------------------------------------------------%
>
> -:- pred sort_error_specs(list(error_spec)::in, list(error_spec)::out) is det.
> +:- pred sort_error_specs(globals::in,
> + list(error_spec)::in, list(error_spec)::out) is det.
> +
> +sort_error_specs(Globals, Specs0, Specs) :-
> + % The purpose of remove_conditionals_in_spec is to remove differences
> + % between error_specs that exist only in the structure of the error_specs
> + % themselves, as opposed to the the text that we output for them.
> + %
> + % For example, prog_io.m can generate two error specs for a bad module
> + % name that differ in two things.
> + %
> + % - The first difference is that one has "severity_error", while the other
> + % has "severity_conditional(warn_wrong_module_name, yes, severity_error,
> + % no)". However, since warn_wrong_module_name is yes by default,
> + % this difference has no effect.
> + %
> + % - The second difference is that some error_msg_components consist of
> + % "always(...)" in one, and "option_is_set(warn_wrong_module_name, yes,
> + % always(...))" in the other. But if warn_wrong_module_name is yes,
> + % this difference has no effect either.
> + %
> + list.filter_map(remove_conditionals_in_spec(Globals), Specs0, Specs1),
> + list.sort_and_remove_dups(compare_error_specs, Specs1, Specs).
> +
Maybe use state variable notation?
The rest looks fine.
--
Paul Bone
More information about the reviews
mailing list