Files
mgmt/lang/interpret_test/TestAstFunc2/test-one-instance-class-arg.txtar
James Shubin 51cf1e2921 lang: ast: The res and edge names should not use exclusives
This removes the exclusive from the res names and edge names. We now
require that the names should be lists of strings, however they can
still be single strings if that can be determined statically.
Programmers should explicitly wrap their variables in a string by
interpolation to force this, or in square brackets to force a list. The
former is generally preferable because it generates a small function
graph since it doesn't need to build a list.
2024-04-18 00:07:53 -04:00

27 lines
572 B
Plaintext

-- CONFIG --
{
"maximum-count": 1
}
-- main.mcl --
import "test"
class use_twice($test1, $test2, $x) {
test "${test1}" {
anotherstr => $x,
}
test "${test2}" {
anotherstr => $x,
}
}
# one_instance_e should only produce one value, and will error if initialized twice
include use_twice("test1", "test2", test.one_instance_e())
# one_instance_f should only produce one value, and will error if initialized twice
include use_twice("test3", "test4", test.one_instance_f())
-- OUTPUT --
Vertex: test[test1]
Vertex: test[test2]
Vertex: test[test3]
Vertex: test[test4]