Resolved #45, Exports region removed

This commit is contained in:
2023-01-13 16:12:44 +00:00
parent 0649a141dd
commit 3498baad9b
12 changed files with 23 additions and 296 deletions

View File

@@ -1,52 +0,0 @@
//test basic import/export
{
var variable: int = 42;
export variable as field;
}
{
import field as value;
assert value == 42, "import/export failed";
}
//test functions using import/export
{
fn f() {
import field;
assert field == 42, "import in function failed";
}
}
//test importing/exporting of functions
{
fn func() {
return 69;
}
export func;
}
{
import func;
assert func() == 69, "import/export of functions failed";
}
//test that variables retain their types with the typeof keyword
{
var t: type = int;
export t;
}
{
import t;
assert typeof t == type, "type retention failed";
}
print "All good";

View File

@@ -1,11 +0,0 @@
//test exports
var field: int = 42;
fn function() {
return 69;
}
export field;
export function;
print "All good";

View File

@@ -1,10 +0,0 @@
//test imports
import field;
//import function;
//assert field == 42, "import field failed";
//assert function() == 69, "import function failed";
print "All good";