lang/interpret_test/TestAstFunc2/import-scope-classes2.txtar
raw| 1 | -- main.mcl -- |
| 2 | $x = "i am x" # i am top-level |
| 3 | |
| 4 | class c2() { |
| 5 | #$y = "i am y" |
| 6 | $z = "i am y and " + $x |
| 7 | |
| 8 | $newx = $x + " and hello" |
| 9 | } |
| 10 | |
| 11 | include c2 as f1 |
| 12 | |
| 13 | test "${f1.z}" {} |
| 14 | test "${f1.x}" {} # tricky |
| 15 | test "${f1.newx}" {} |
| 16 | |
| 17 | -- OUTPUT -- |
| 18 | Vertex: test[i am x] |
| 19 | Vertex: test[i am x and hello] |
| 20 | Vertex: test[i am y and i am x] |