mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 18:03:36 +00:00
tests/submodules/*.m:
Rename modules as mentioned above.
Indent nested submodules to make them stand out.
Group foreign_procs by what predicate they implement, not by
their implementation language.
tests/submodules/*.m:
tests/submodules/*.err_exp:
tests/submodules/Mmakefile:
tests/submodules/Mercury.options:
Update all references to the moved modules.
41 lines
1.1 KiB
Mathematica
41 lines
1.1 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% Test potential problems with direct argument type representation and
|
|
% submodules.
|
|
|
|
:- module direct_arg_parent.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- include_module direct_arg_parent.direct_arg_parent_helper_1.
|
|
:- import_module direct_arg_parent.direct_arg_parent_helper_1.
|
|
|
|
:- type maybe_foo
|
|
---> no
|
|
; not_possible(foo)
|
|
; forced(foo)
|
|
where direct_arg is [forced/1].
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
main(!IO) :-
|
|
M1 = not_possible(foo(one, 1)),
|
|
M2 = forced(foo(one, 2)),
|
|
direct_arg_parent_helper_1.write_maybe_foo(M1, !IO),
|
|
direct_arg_parent_helper_1.write_maybe_foo(M2, !IO).
|
|
|
|
:- func one = int.
|
|
:- pragma no_inline(one/0).
|
|
|
|
one = 1.
|