mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 21:33:49 +00:00
Estimated hours taken: 4 Add meaningful contexts to the goals inserted into predicates by tabling, for use by the debugger. compiler/table_gen.m: Pass the context of the procedure body through the code, and create new goals with this context. To make this simpler, switch to consistently using combined predmode definitions. In a couple of places, switch to a more reasonable argument ordering. tests/debugger/loopcheck.* Copy this test case here from the tabling directory, and execute it under mdb, as a regression test. The exp2 test case is not final yet. tests/debugger/Mmakefile: Enable the regression test.
22 lines
452 B
Mathematica
22 lines
452 B
Mathematica
% Regression test, for making sure that tabling inserts meaningful contexts
|
|
% into the goal_infos of the goals it inserts into procedure bodies, for use
|
|
% by the debugger.
|
|
|
|
:- module loopcheck.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
main -->
|
|
{ loop(10) },
|
|
io__write_string("Hello, world\n").
|
|
|
|
:- pragma loop_check(loop/1).
|
|
:- pred loop(int::in) is erroneous.
|
|
|
|
loop(X) :-
|
|
loop(X).
|