| 1 |
-- main.mcl -- |
| 2 |
import "value" |
| 3 |
|
| 4 |
value "hello1" { |
| 5 |
#any => 42, # can be any type |
| 6 |
any => "wow", # can be any type |
| 7 |
} |
| 8 |
value "hello2" { |
| 9 |
any => "whatever", # TODO: remove the temporary placeholder here |
| 10 |
#any => "", # XXX: remove any placeholder to see the bug when absent |
| 11 |
} |
| 12 |
|
| 13 |
test "test" { |
| 14 |
#anotherstr => "", # get it from send/recv |
| 15 |
} |
| 16 |
|
| 17 |
Value["hello1"].any -> Value["hello2"].any |
| 18 |
Value["hello2"].any -> Test["test"].anotherstr |
| 19 |
|
| 20 |
$ret1 = value.get_str("hello1") # name of value resource |
| 21 |
$ret2 = value.get_str("hello2") # name of value resource |
| 22 |
|
| 23 |
test "get1" { |
| 24 |
anotherstr => $ret1->value, |
| 25 |
onlyshow => ["AnotherStr",], # displays nicer |
| 26 |
} |
| 27 |
|
| 28 |
test "get2" { |
| 29 |
anotherstr => $ret2->value, |
| 30 |
onlyshow => ["AnotherStr",], |
| 31 |
} |
| 32 |
# XXX: Field entries for test[get1] and test[get2] aren't seen yet :( |
| 33 |
-- OUTPUT -- |
| 34 |
Edge: value[hello1] -> value[hello2] # value[hello1] -> value[hello2] |
| 35 |
Edge: value[hello2] -> test[test] # value[hello2] -> test[test] |
| 36 |
Field: test[get1].OnlyShow = ["AnotherStr"] |
| 37 |
Field: test[get2].OnlyShow = ["AnotherStr"] |
| 38 |
Field: test[test].AnotherStr = "wow" |
| 39 |
Field: value[hello1].Any = "wow" |
| 40 |
Field: value[hello2].Any = "wow" |
| 41 |
Vertex: test[get1] |
| 42 |
Vertex: test[get2] |
| 43 |
Vertex: test[test] |
| 44 |
Vertex: value[hello1] |
| 45 |
Vertex: value[hello2] |