1
0
forked from Mirror/wren
Files
wren/test/module/multiple_variables/multiple_variables.wren
Bob Nystrom bb647d4247 Start getting module loading working.
Right now, it uses a weird "import_" method on String which
should either be replaced or at least hidden behind some syntax.

But it does roughly the right thing. Still lots of corner cases to
clean up and stuff to fix. In particular:

- Need to handle compilation errors in imported modules.
- Need to implicitly import all core and IO types into imported module.
- Need to handle circular imports.
  (Just need to give entry module the right name for this to work.)
2015-02-06 07:01:15 -08:00

15 lines
522 B
Plaintext

var Module1 = "module.wren".import_("Module1")
var Module2 = "module.wren".import_("Module2")
var Module3 = "module.wren".import_("Module3")
var Module4 = "module.wren".import_("Module4")
var Module5 = "module.wren".import_("Module5")
// Only execute module body once:
// expect: ran module
IO.print(Module1) // expect: from module one
IO.print(Module2) // expect: from module two
IO.print(Module3) // expect: from module three
IO.print(Module4) // expect: from module four
IO.print(Module5) // expect: from module five