Files
mgmt/lang/interpret_test/TestAstFunc2/structlookup2.txtar
James Shubin 6cc5adcd25 lang, test, examples: lang: Use new syntax for structlookup
Sugar makes the world go round.
2023-11-04 14:52:19 -04:00

23 lines
408 B
Plaintext

-- main.mcl --
$st0 struct{x str} = struct{x => "hello",}
test $st0->x {}
$st1 = struct{y => "world",}
test $st1->y {}
$st2 = struct{x => true, y => 42, z => "hello world",}
test $st2->z {}
test "foo" {
mixedstruct => struct{
somebool => true,
somestr => "hi",
someint => 42,
somefloat => 1.0,
},
}
-- OUTPUT --
Vertex: test[foo]
Vertex: test[hello world]
Vertex: test[hello]
Vertex: test[world]