Files
mgmt/lang/interpret_test/TestAstFunc1/importscope0.txtar
2023-06-01 16:56:44 -04:00

29 lines
822 B
Plaintext

-- main.mcl --
import "second.mcl"
include second.xclass
-- second.mcl --
import "os"
import "fmt"
class xclass {
#import "os" # this should not be required, top-level should be enough
$aaa = if os.is_debian() { "bbb" } else { "ccc" }
print "${aaa}" {
msg => "hello",
}
}
-- OUTPUT --
Edge: call:os.is_debian() -> if( call:os.is_debian() ) { str("bbb") } else { str("ccc") } # c
Edge: if( call:os.is_debian() ) { str("bbb") } else { str("ccc") } -> var(aaa) # var:aaa
Edge: str("bbb") -> if( call:os.is_debian() ) { str("bbb") } else { str("ccc") } # a
Edge: str("ccc") -> if( call:os.is_debian() ) { str("bbb") } else { str("ccc") } # b
Vertex: call:os.is_debian()
Vertex: if( call:os.is_debian() ) { str("bbb") } else { str("ccc") }
Vertex: str("bbb")
Vertex: str("ccc")
Vertex: str("hello")
Vertex: var(aaa)