lang/interpret_test/TestAstFunc2/class-include-as-vars1.txtar
raw| 1 | -- main.mcl -- |
| 2 | class c1($b) { |
| 3 | test "t1" {} |
| 4 | if $b { |
| 5 | test "t2" {} |
| 6 | } else { |
| 7 | test "t3" {} |
| 8 | } |
| 9 | $x = if $b { |
| 10 | "hello" |
| 11 | } else { |
| 12 | "goodbye" |
| 13 | } |
| 14 | } |
| 15 | include c1(true) as i1 |
| 16 | include c1(false) as i2 |
| 17 | |
| 18 | test "${i1.x}" {} |
| 19 | test "${i2.x}" {} |
| 20 | -- OUTPUT -- |
| 21 | Vertex: test[hello] |
| 22 | Vertex: test[goodbye] |
| 23 | Vertex: test[t1] |
| 24 | Vertex: test[t2] |
| 25 | Vertex: test[t3] |