Make the `for` clause in import statements optional, and support comma-separated lists of imported names when present. This removes the previous restriction of exactly one imported variable per import statement. - Refactor `import()` in compiler to handle optional `for` clause with loop over comma-separated names - Update existing tests to use comma-separated imports and omit `for` clause where appropriate - Add new tests: `inside_block`, `name_collision`, `no_variable`
11 lines
351 B
Plaintext
11 lines
351 B
Plaintext
import "module" for Module1, Module2, Module3, Module4, 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
|