mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 22:03:26 +00:00
Estimated hours taken: 8 Branches: main Add optional support for generating a pure interface to mutables. This is done by adding a new mutable attribute, `attach_to_io_state'. If this attribute is specified in the mutable declaration then in addition to the usual non-pure access predicates, the compiler will also add a pair of access predicates that take the IO state. compiler/prog_data.m: Add the `attach_to_io_state' mutable attribute. Add the necessary access predicates for the mutable_var_attributes structure. compiler/prog_io.m: Parse the `attach_to_io_state' attribute. compiler/prog_mutable.m: Shift some of the code for constructing items related to mutables to this module from make_hlds_passes. This reduces unnecessary clutter in the latter. Remove the XXX comment about needing to mangle the names of the globals - we now do that. compiler/make_hlds_passes.m: If a mutable has the `attach_to_io_state' attribute specified then create pure access predicates that take the IO state in addition to the non-pure ones. compiler/modules.m: If we are generating the pure access predicates then output the declarations for these predicates in private interfaces. compiler/type_util.m: Replace the use of ':' as a module qualifier in some comments. doc/reference_manual.texi: Document the `attach_to_io_state' mutable attribute. vim/syntax/mercury.vim: Highlight various mutable attributes appropriately. tests/hard_coded/Mmakefile: tests/hard_coded/pure_mutable.m: tests/hard_coded/pure_mutable.exp: Test mutables with pure access predicates. tests/hard_coded/ppc_bug.m: Unrelated change: update the comments in this test case so they describe what the cause of the bug and the fix were.