Files
mercury/tests/invalid/ft_examples
Zoltan Somogyi c45719f5cb Don't report errors when creating interface files.
When deciding the contents of interface files, we used to generate
messages for these three kinds of errors:

- clauses in the module interface
- not-allowed-in-the-interface pragmas in the module interface
- empty module interface

None of these affected the interface file we were building, and their
reporting can easily be delayed until we are compiling the affected module
to target language code. At that time, the error messages get put into
.err files, whereas any messages printed when creating interface files
tends to get lost in the overall sea of compiler invocation messages
when running mmake.

compiler/comp_unit_interface.m:
    Do not generate error messages when building the contents of interface
    files.

compiler/write_module_interface_files.m:
    Do not print the error messages that are no longer being generated.
    We *do* still print any of the other kinds of error messages we have
    been printing, such as for those when a needed .int3 file cannot be read,
    or when ambiguity prevents full module qualification. (The contents of
    .int and .int2 files must be fully module qualified to do their jobs.)

compiler/add_pragma.m:
    Report an error when processing a pass 3 pragma that occurs in the
    interface but is not allowed in the interface.

    add_pragma.m has already been doing this for all other kinds of pragmas,
    and in general, compiler invocations that generate target language code
    do generate the messages for all the conditions whose messages we are
    no longer printing when generating interface files.

tests/invalid/bad_item_in_interface.{m,err_exp}:
tests/invalid/ft_examples:
    A new test case to test the above assertion with respect to
    inappropriate items in the interface of a module.

tests/invalid/empty_interface.{m,err_exp}:
    A new test case to test the above assertion with respect to
    the interface of a module being empty.

tests/invalid/Mercury.options:
    Specify the right options for the empty_interface test case.

tests/invalid/Mmakefile:
    Enable the new test cases.
2019-08-27 06:06:17 +10:00

2 lines
18 B
Plaintext