Debian Codegraph @

lang/interpret_test/TestAstFunc2/maplookup0.txtar

raw
1 -- main.mcl --
2 $map1 map{int: str} = {42 => "hello1",}
3 $name1 = $map1[42] || "not found"
4 test "${name1}" {}
5
6 $map2 map{int: str} = {42 => "hello2",}
7 $name2 = $map2[13] || "world2"
8 test "${name2}" {}
9
10 $map3 = {42 => "hello3",}
11 $name3 = $map3[42] || "not found"
12 test "${name3}" {}
13
14 $map4 = {42 => "hello4",}
15 $name4 = $map4[13] || "world4"
16 test "${name4}" {}
17 -- OUTPUT --
18 Vertex: test[hello1]
19 Vertex: test[hello3]
20 Vertex: test[world2]
21 Vertex: test[world4]