mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 22:03:26 +00:00
Estimated hours taken: 0.5 Another fix to make things work with my change to ensure that the declarations and definitions for data constants specify the same linkage (extern or static). tests/valid/headvar_not_found.m: tests/valid/subtype_switch.m: Add definitions for types which were declared but not defined.
33 lines
788 B
Mathematica
33 lines
788 B
Mathematica
:- module headvar_not_found.
|
|
|
|
:- interface.
|
|
:- import_module list.
|
|
|
|
:- type (mode).
|
|
:- type module_info.
|
|
|
|
:- pred inputs_precede_outputs(list(mode), module_info).
|
|
:- mode inputs_precede_outputs(in, in) is semidet.
|
|
|
|
:- implementation.
|
|
|
|
% we need dummy definitions of these types
|
|
:- type (mode) ---> mode(int, int).
|
|
:- type module_info ---> module_info(int, int).
|
|
|
|
:- pred mode_is_input(module_info::in, (mode)::in) is semidet.
|
|
:- external(mode_is_input/2).
|
|
|
|
% succeed iff all the inputs in the list of modes precede the outputs
|
|
|
|
inputs_precede_outputs([], _).
|
|
inputs_precede_outputs([Mode | Modes], ModuleInfo) :-
|
|
( mode_is_input(ModuleInfo, Mode) ->
|
|
inputs_precede_outputs(Modes, ModuleInfo)
|
|
;
|
|
\+ (
|
|
list__member(OtherMode, Modes),
|
|
mode_is_input(ModuleInfo, OtherMode)
|
|
)
|
|
).
|