Allow modules to use other modules (#6162)

* Allow private imports inside modules

Can call `use ...` inside modules now.

* Add more tests

* Add a leak test

* Refactor exportables; Prepare for 'export use'

* Fix description

* Implement 'export use' command

This allows re-exporting module's commands and aliases from another
module.

* Add more tests; Fix import pattern list strings

The import pattern strings didn't trim the surrounding quotes.

* Add ignored test
This commit is contained in:
Jakub Žádník
2022-07-29 11:57:10 +03:00
committed by GitHub
parent cf2e9cf481
commit 2cffff0c1b
10 changed files with 620 additions and 117 deletions

View File

@ -1,7 +1,7 @@
use crate::{AliasId, BlockId, DeclId};
pub enum Exportable {
Decl(DeclId),
Alias(AliasId),
EnvVar(BlockId),
Decl { name: Vec<u8>, id: DeclId },
Alias { name: Vec<u8>, id: AliasId },
EnvVar { name: Vec<u8>, id: BlockId },
}