mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 22:03:26 +00:00
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.
37 lines
587 B
Mathematica
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.
|
|
|
|
'$'.
|
|
'#'.
|
|
|
|
'$$' :- '##'.
|
|
'##' :- '$$'.
|