Files
mercury/tests/valid/headvar_not_found.m
Fergus Henderson 381b7dc22d Another fix to make things work with my change to
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.
1998-09-04 10:08:56 +00:00

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)
)
).