dir import
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#import "modules/std.sx";
|
||||
pkg :: #import "modules/testpkg";
|
||||
|
||||
// ============================================================
|
||||
// Comprehensive Smoke Test — exercises every spec feature
|
||||
@@ -1351,5 +1352,13 @@ END;
|
||||
print("{}\n", 5 in (1, 2, 3)); // false
|
||||
}
|
||||
|
||||
// --- Directory imports ---
|
||||
{
|
||||
print("--- directory imports ---\n");
|
||||
print("{}\n", pkg.add(3, 4)); // 7
|
||||
print("{}\n", pkg.mul(5, 6)); // 30
|
||||
print("{}\n", pkg.hello()); // hello from testpkg
|
||||
}
|
||||
|
||||
print("=== DONE ===\n");
|
||||
}
|
||||
|
||||
1
examples/modules/testpkg/greet.sx
Normal file
1
examples/modules/testpkg/greet.sx
Normal file
@@ -0,0 +1 @@
|
||||
hello :: () -> string { "hello from testpkg"; }
|
||||
2
examples/modules/testpkg/math.sx
Normal file
2
examples/modules/testpkg/math.sx
Normal file
@@ -0,0 +1,2 @@
|
||||
add :: (a: s32, b: s32) -> s32 { a + b; }
|
||||
mul :: (a: s32, b: s32) -> s32 { a * b; }
|
||||
Reference in New Issue
Block a user