Zoltan Somogyi 9e01e8da4a Improve error messages for bad insts in mutables.
compiler/add_mutable_aux_preds.m:
compiler/hlds_code_util.m:
    Move the code that tests the insts in mutables to see if they are allowed
    in mutables from hlds_code_util.m to add_mutable_aux_preds.m, since that
    code is not a generally useful utility.

    Change that code so that instead of generating the same error message
    ("this is not a valid inst for a mutable") for all errors, we now
    (a) generate a separate error message for each problem in the inst, and
    (b) generate a message that is specific to the error, for each such
    error.

compiler/prog_item.m:
    Record two insts for each mutable, not one. The two differ in that
    one is processed by equiv_type.m, the other isn't. If possibly,
    add_mutable_aux_preds.m generates error messages from the latter,
    because it preserves the original structure of the inst. This is
    important, because having the compiler complain about e.g. a "unique"
    inst in a mutable is confusing if the inst in the mutable is just "i1".
    You want the error message to explain that "unique" is part of the
    expansion of "i1", and this can only be done if the test works on an inst
    in which equiv_type.m hasn't replaced "i1" with its definition.

    Record two types for each mutable, not one, with the same difference,
    for the same reason, for use by future checks on types in mutables.

    Put the fields of item_mutable_infos into a more logical order.

compiler/equiv_type.m:
    Process only one of each pair of type and inst fields in
    item_mutable_infos.

compiler/get_dependencies.m:
compiler/module_qual.m:
compiler/parse_tree_out.m:
compiler/prog_io_mutable.m:
compiler/recompilation.version.m:
compiler/write_module_interface_files.m:
    Conform to the change in prog_item.m.

tests/invalid/bad_mutable.err_exp:
tests/invalid/user_mutable.err_exp:
    Expect the improved error messages.
2015-11-09 15:10:00 +11:00
2015-11-08 14:52:08 +11:00
2015-09-09 04:19:19 +10:00
2015-09-21 11:34:46 +10:00
2015-09-21 11:34:46 +10:00
2015-09-03 21:15:38 +10:00
2015-03-27 13:40:24 +11:00
2015-08-31 17:16:57 +10:00
2015-10-16 15:11:17 +11:00
2015-10-19 10:49:44 +11:00

Mercury

Mercury is a logic/functional programming language which combines the clarity and the expressiveness of declarative programming with advanced static analysis and error detection features.

More information is available on the website's about pages, in other README files in the source code repository, and in the documentation.

README files

The Mercury compiler has a number of different backends and works on different operating systems. Specific information is contained in individual README files:

Other information

See the current release notes for the latest stable release. The history file is relevant if you want to find out more about the past development of Mercury. News lists any current or future enhancements (but this isn't always up-to-date). The limitations file lists a number of ways in which the Mercury implementation does not yet meet its goals.

Information for developers

If you are considering contributing to the Mercury project the website contains some documents that may be helpful. These include a document about contributions in general and specific information about contributing such as coding styles.

Contact

See our contact page.

Description
No description provided
Readme MIT 145 MiB
Languages
Mercury 85.4%
C 8.7%
Shell 1.4%
Makefile 1%
JavaScript 1%
Other 2%