mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 08:14:31 +00:00
Branches: main Estimated hours taken: 0.5 tests/hard_coded/sub-modules/Mmakefile: tests/hard_coded/sub-modules/deeply_nested.m: tests/hard_coded/sub-modules/deeply_nested.exp: Add a test case for deeply nested uses of "use_module" and "include_module".
51 lines
1.2 KiB
Mathematica
51 lines
1.2 KiB
Mathematica
:- module deeply_nested.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- module a.
|
|
:- interface.
|
|
:- module b.
|
|
:- interface.
|
|
:- module c.
|
|
:- interface.
|
|
:- module d.
|
|
:- interface.
|
|
:- module e.
|
|
:- interface.
|
|
:- type f ---> f.
|
|
:- end_module e.
|
|
:- end_module d.
|
|
:- end_module c.
|
|
:- end_module b.
|
|
:- end_module a.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module deeply_nested.a.
|
|
:- import_module deeply_nested.a.b.
|
|
:- use_module deeply_nested.a.b.c.
|
|
:- import_module deeply_nested.a.b.c.d.
|
|
:- use_module deeply_nested.a.b.c.d.e.
|
|
|
|
:- type t0 == deeply_nested.a.b.c.d.e.f.
|
|
:- type t1 == a.b.c.d.e.f.
|
|
:- type t2 == b.c.d.e.f.
|
|
:- type t3 == c.d.e.f.
|
|
% :- type t4 == d.e.f. % error, "d" must be referred to as "c.d"
|
|
:- type t5 == e.f.
|
|
% :- type t6 == f. % error, "f" must be referred to as "e.f"
|
|
|
|
main -->
|
|
print(deeply_nested.a.b.c.d.e.f), nl,
|
|
print(a.b.c.d.e.f), nl,
|
|
print(b.c.d.e.f), nl,
|
|
print(c.d.e.f), nl,
|
|
% print(d.e.f), nl, % error, "d" must be referred to as "c.d"
|
|
print(e.f), nl,
|
|
% print(f), nl, % error, "f" must be referred to as "e.f"
|
|
[].
|
|
|
|
:- end_module deeply_nested.
|