raz / conform / err / Recover.raz

40 lines · 493 B · raw · history · last change 1d7484fe

1module Recover;
2
3import Out;
4
5type
6 P = record a: I64; b: Foo; end;
7 Q = record a: I64; end;
8
9var g: Bar;
10 h: I64;
11
12proc f(x: I64): I64;
13var b: BOOL;
14begin
15 b := x;
16 x := y + 1;
17 x := y * 2;
18 if x = 1 then
19 x := (x + 2) * b;
20 Out.int(z);
21 end;
22 return x + true;
23end f;
24
25proc g2(): Q;
26var q: Q;
27begin
28 q.c := 1;
29 h := g;
30 Out.str("hi")
31 return q;
32end g2;
33
34proc main*();
35begin
36 Out.int(f(1));
37 Out.int(nope(2));
38end main;
39
40end Recover.