lang/interpret_test/TestAstFunc1/static-function0.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "fmt" |
| 3 | |
| 4 | # we should only see one copy of $fn |
| 5 | $fn = func() { |
| 6 | "hello world" |
| 7 | } |
| 8 | |
| 9 | test "greeting1" { |
| 10 | anotherstr => $fn(), |
| 11 | } |
| 12 | test "greeting2" { |
| 13 | anotherstr => $fn(), |
| 14 | } |
| 15 | test "greeting3" { |
| 16 | anotherstr => $fn(), |
| 17 | } |
| 18 | -- OUTPUT -- |
| 19 | Edge: FuncValue -> call # fn |
| 20 | Edge: FuncValue -> call # fn |
| 21 | Edge: FuncValue -> call # fn |
| 22 | Vertex: FuncValue |
| 23 | Vertex: call |
| 24 | Vertex: call |
| 25 | Vertex: call |
| 26 | Vertex: const |
| 27 | Vertex: const |
| 28 | Vertex: const |