feat: fall back to loading module package when module file not found

Extract file path construction into `wrenFilePath` helper and modify `readModule` to first attempt loading the module as a `.wren` file. If that fails, treat the module name as a package directory and try to load `module.wren` from within it. Add test files `module_package/module.wren` and `package_module.wren` to verify the new package resolution behavior.
This commit is contained in:
Gavin Schulz
2015-03-21 23:05:02 +00:00
parent 65305fca09
commit 1374797192
3 changed files with 39 additions and 10 deletions
@@ -0,0 +1 @@
var Index = "index"
+3
View File
@@ -0,0 +1,3 @@
import "module_package" for Index
IO.print(Index) // expect: index