[m-rev.] for post-commit review: use standard mode names in proc arg lists in diagnostics
Julien Fischer
jfischer at opturion.com
Sun Mar 19 14:27:07 AEDT 2023
On Sun, 19 Mar 2023, Zoltan Somogyi wrote:
> Standardize mode names in argument lists.
>
> compiler/hlds_error_util.m:
> When converting lists of arguments mode to strings for error messages,
> replace from/to pairs of insts that stand for standard modes with the
> names of those standard modes.
>
> compiler/prog_mode.m:
> Add a utility function for doing that standardization.
>
> tests/invalid/io_in_ite_cond.err_exp:
> tests/invalid_manual/gh118.err_exp:
> Expect the standard forms of modes.
>
> tests/invalid_manual/Mmakefile:
> Specify the grade for the test independently of the grade of the
> workspace or of the last bootcheck. Make the Mercury compiler flags
> specific to the test.
In practice this means that if the programmer wrote the expanded version of the
mode in their program, then they'll get the short form in the error message --
I think we can live with that.
The change is fine, although I wonder whether it might be worth also having
from_to_insts_is_standard_mode/3 also recognise unused/0 as a standard mode.
Julien.
More information about the reviews
mailing list