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