Files
mercury/tests/valid/intermod_quote2.m
Fergus Henderson 58eb75f18c Fix a quoting bug that caused the compiler to generate `.opt' files
Estimated hours taken: 1

Fix a quoting bug that caused the compiler to generate `.opt' files
containing syntax errors.

compiler/mercury_to_mercury.m:
compiler/hlds_out.m:
	Fix some more quoting problems: it was not properly quoting
	certain subterms when they occurred immediately before the final
	`.' at the end of a term.

tests/valid/intermod_quote2.m:
	Add some regression tests for the above bug fix.

tests/valid/Mmakefile:
	Fix a bug in the Mmakefile that meant that the intermod_quote
	test didn't work properly when --use-subdirs was enabled.
1999-06-09 16:39:47 +00:00

37 lines
587 B
Mathematica

% Regression test to ensure that terms are properly quoted in the intermodule
% .opt file.
:- module intermod_quote2.
:- interface.
:- import_module char.
:- func '*'(func(X) = Y, func(Y) = Z, X) = Z.
:- mode '*'(func(in) = out is det, func(in) = out is det, in) = out is det.
:- func dollar = char.
:- func hash = char.
:- func '$' = int.
:- func '#' = int.
:- pred '$' is det.
:- pred '#' is det.
:- pred '$$' is semidet.
:- pred '##' is semidet.
:- implementation.
'*'(F, G, X) = G(F(X)).
dollar = '$'.
hash = '#'.
'$' = 42.
'#' = 43.
'$'.
'#'.
'$$' :- '##'.
'##' :- '$$'.