mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
compiler/parse_item.m:
Don't accept `:- external' items.
compiler/prog_item.m:
Require the presence of a pred_or_func flag on external pragmas.
They are specified by `:- pragma external_{pred/func}' pragmas,
which are still supported.
compiler/parse_pragma.m:
When parsing external_{pred/func} pragmas, allow the predicate name
to contain a module qualifier; they were allowed on `:- external' items.
We do require the module qualifier to specify the expected (i.e. the
current) module.
compiler/add_pragma.m:
compiler/parse_tree_out_pragma.m:
compiler/recompilation.version.m:
Conform to the changes above.
tests/hard_coded/backend_external.m:
tests/hard_coded/constant_prop_2.m:
tests/invalid/external.err_exp:
tests/invalid/external.m:
tests/invalid/io_in_ite_cond.err_exp:
tests/invalid/io_in_ite_cond.m:
tests/invalid/overloading.m:
tests/invalid/tricky_assert1.m:
tests/invalid/type_spec.err_exp:
tests/invalid/type_spec.m:
tests/invalid/uniq_neg.err_exp:
tests/invalid/uniq_neg.m:
tests/valid/dcg_test.m:
tests/valid/inst_perf_bug_1.m:
tests/valid/lambda_recompute.m:
tests/valid/semidet_disj.m:
tests/valid/solv.m:
tests/valid/solver_type_bug.m:
tests/valid/stack_alloc.m:
tests/valid/tricky_assert2.m:
Replace `:- external' items with external_{pred/func} pragmas.
Modernize the code where needed, replacing DCGs with state variables.
36 lines
906 B
Mathematica
36 lines
906 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module dcg_test.
|
|
|
|
:- interface.
|
|
|
|
:- pred q(int::in, int::out) is semidet.
|
|
:- pred r(int::in, int::out) is semidet.
|
|
:- pred s(int::in, int::out) is semidet.
|
|
:- pred q is semidet.
|
|
:- pred r is semidet.
|
|
:- pred s is semidet.
|
|
|
|
:- implementation.
|
|
|
|
:- pragma external_pred(q/2).
|
|
:- pragma external_pred(r/2).
|
|
:- pragma external_pred(s/2).
|
|
:- pragma external_pred(q/0).
|
|
:- pragma external_pred(r/0).
|
|
:- pragma external_pred(s/0).
|
|
|
|
:- pred p(int::in, int::out) is nondet.
|
|
|
|
p --> ( q -> r ; s ).
|
|
p --> ( { q } -> r ; s ).
|
|
p --> ( q -> { r } ; s ).
|
|
p --> ( { q } -> { r } ; s ).
|
|
p --> ( q -> r ; { s } ).
|
|
p --> ( { q } -> r ; { s } ).
|
|
p --> ( q -> { r } ; { s } ).
|
|
p --> ( { q } -> { r } ; { s } ).
|
|
p --> { ( q -> r ; s ) }.
|