lang/interpret_test/TestAstFunc1/returned-func.txtar
raw| 1 | -- main.mcl -- |
| 2 | # simple function definition containing function to be returned |
| 3 | func funcgen() { |
| 4 | func() { |
| 5 | "hello" |
| 6 | } |
| 7 | } |
| 8 | |
| 9 | $fn = funcgen() |
| 10 | $out = $fn() |
| 11 | |
| 12 | test "${out}" {} |
| 13 | -- OUTPUT -- |
| 14 | Edge: FuncValue -> call # fn |
| 15 | Edge: call -> call # fn |
| 16 | Vertex: FuncValue |
| 17 | Vertex: call |
| 18 | Vertex: call |