mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 17:24:34 +00:00
Estimated hours taken: 1
Branches: main
When compiling a module which contains a nested sub-module you must
build the .int0 file before attempting to build the .int file. This is
because while building the .int file you will need the .int0 file to
build the .int file of the nested sub-module.
compiler/modules.m:
When generating the .d file for a nested submodule. Add the rule
<sourcefilename>.date : <sourcefilename>.int0
where <sourcefilename> is the name of the sourcefile which contains
the nested sub-module.
tests/hard_coded/sub-modules/Mmakefile:
tests/hard_coded/sub-modules/include_parent.m:
tests/hard_coded/sub-modules/include_parent.separate.m:
tests/hard_coded/sub-modules/use_submodule.exp:
tests/hard_coded/sub-modules/use_submodule.m:
Include a test which tests that we can build both nested and
separate sub-modules when they are not the module which contains
main.
31 lines
738 B
Mathematica
31 lines
738 B
Mathematica
% Used by use_submodule.m
|
|
|
|
:- module include_parent__separate.
|
|
|
|
:- interface.
|
|
|
|
% The parent module includes io.
|
|
|
|
:- pred hello(io__state::di, io__state::uo) is det.
|
|
|
|
:- pred hello2(io__state::di, io__state::uo) is det.
|
|
|
|
:- module include_parent__separate__nested.
|
|
:- interface.
|
|
:- pred hello3(io__state::di, io__state::uo) is det.
|
|
:- end_module include_parent__separate__nested.
|
|
|
|
:- implementation.
|
|
|
|
hello -->
|
|
io__write_string("include_parent__separate: hello\n").
|
|
|
|
hello2 -->
|
|
io__write_string("include_parent__separate: hello2\n").
|
|
|
|
:- module include_parent__separate__nested.
|
|
:- implementation.
|
|
hello3 -->
|
|
io__write_string("include_parent__separate__nested: hello\n").
|
|
:- end_module include_parent__separate__nested.
|