The search path listed in an import directive can now be an array. The top-level search path is appended. Null and empty strings in the path terminate any search. The "." in "." and "./*" is replaced with the directory containing the file doing the import (for command-line programs this is the current directory, though that may be a bad idea). No version numbers or anything of the sort are gratuitously added to the search paths. All this makes external package managers possible by allowing dependencies to be installed local to dependents.
15 lines
572 B
Plaintext
15 lines
572 B
Plaintext
module c {whatever:null};
|
|
import a as foo;
|
|
import d as d {search:"./"};
|
|
import d {search:"./"};
|
|
import e as e {search:"./../lib/jq"};
|
|
import f as f {search:"./../lib/jq"};
|
|
def a: 0;
|
|
def c:
|
|
if meh != d::meh then error("import into namespace doesn't work")
|
|
elif foo::a != "a" then error("foo::a didn't work as expected")
|
|
elif d::meh != "meh" then error("d::meh didn't work as expected")
|
|
elif e::bah != "bah" then error("e::bah didn't work as expected")
|
|
elif f::f != "f is here" then error("f::f didn't work as expected")
|
|
else foo::a + "c" + d::meh + e::bah end;
|