Allow multiple exports.

This commit is contained in:
Stephen Chung
2020-11-09 14:38:33 +08:00
parent 173f8474d6
commit 821e64adc4
8 changed files with 43 additions and 38 deletions

View File

@@ -46,6 +46,18 @@ export x as answer; // the variable 'x' is exported under the alias 'answer'
}
```
### Multiple Exports
One `export` statement can export multiple variables, even under multiple names.
```rust
// The following exports three variables:
// - 'x' (as 'x' and 'hello')
// - 'y' (as 'foo' and 'bar')
// - 'z' (as 'z')
export x, x as hello, x as world, y as foo, y as bar, z;
```
Export Functions
----------------