lang/interpret_test/TestAstFunc2/class-include-as-lambda1.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 | $f1 = func() { |
| 10 | if $b { |
| 11 | "hello" |
| 12 | } else { |
| 13 | "goodbye" |
| 14 | } |
| 15 | } |
| 16 | } |
| 17 | include c1(true) as i1 |
| 18 | include c1(false) as i2 |
| 19 | |
| 20 | $name1 = $i1.f1() |
| 21 | $name2 = $i2.f1() |
| 22 | |
| 23 | test "${name1}" {} |
| 24 | test "${name2}" {} |
| 25 | -- OUTPUT -- |
| 26 | Vertex: test[hello] |
| 27 | Vertex: test[goodbye] |
| 28 | Vertex: test[t1] |
| 29 | Vertex: test[t2] |
| 30 | Vertex: test[t3] |