1: (* 2: * Test of nested functions. 3: *) 4: 5: program nested (input, output); 6: var 7: i, k : integer; 8: 9: function f (var i : integer) : integer; 10: var 11: j, k : integer; 12: 13: function nestedf (var j : integer) : integer; 14: var 15: i : integer; 16: begin 17: i := j + 2; 18: j := i; 19: nestedf := j; 20: end; 21: 22: begin 23: j := i + 1; 24: i := nestedf(j); 25: i := j; 26: f := i; 27: end; 28: 29: begin 30: i := 3; 31: i := f(i); 32: end.