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.
31 lines
775 B
Plaintext
31 lines
775 B
Plaintext
-- main.mcl --
|
|
class c1 {
|
|
test "t1" {}
|
|
$y = "hello"
|
|
class c0 {
|
|
test "t2" {}
|
|
$x = "goodbye"
|
|
}
|
|
}
|
|
include c1 as i1 # has $y
|
|
include i1.c0 as i0 # has $x ...and $y
|
|
|
|
test "${i0.x}" {} # ok
|
|
test "${i1.y}" {} # ok
|
|
panic($i0.x != "goodbye")
|
|
panic($i1.y != "hello")
|
|
|
|
# the really tricky case
|
|
# XXX: works atm, but not supported for now: could not set scope: variable i0.y not in scope
|
|
# We currently re-export anything in the parent scope as available from our
|
|
# current child scope, which makes this variable visible. Unfortunately, it does
|
|
# not have the correct dependency (edge) present in the Ordering system, so it
|
|
# is flaky depending on luck of the toposort.
|
|
#test "${i0.y}" {}
|
|
|
|
-- OUTPUT --
|
|
Vertex: test[goodbye]
|
|
Vertex: test[hello]
|
|
Vertex: test[t1]
|
|
Vertex: test[t2]
|