raz / test / run / Trace.raz

31 lines · 602 B · raw · history · last change a5915c27

1module Trace;
2(* The calls under way, with their variables: on demand with Rt.trace,
3 and after a failed check *)
4import Out, Rt;
5
6type Color = (red, green, blue);
7
8proc inner(var n: I64; f: F64; ok: BOOL; c: Color; b: U8; s: I16);
9var a: [2]I64; k: INT;
10begin
11 Rt.trace;
12 if ok and (c = blue) and (b > 0) and (s < 0) and (f < 0.0) then k := INT(n); end;
13 a[k] := 1;
14end;
15
16proc outer(n: I64);
17var x: I64; r: F32;
18begin
19 r := 0.25;
20 x := n + 1 + I64(r);
21 inner(x, -1.5, true, blue, 200, -7);
22end;
23
24proc main*;
25begin
26 Out.str("go\n");
27 Out.flush;
28 outer(4);
29end;
30
31end Trace.