Updated docs to new version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Modules & Imports
|
||||
description: Module declarations, imports, re-exports, and module resolution rules.
|
||||
description: Module declarations, imports, re-exports, include directives, and module resolution rules.
|
||||
icon: FolderTree
|
||||
---
|
||||
|
||||
@@ -18,6 +18,23 @@ use std::collections::HashMap;
|
||||
pub use my_module::MyType;
|
||||
```
|
||||
|
||||
### Include Directives
|
||||
|
||||
Mist supports C-style include directives for importing external files and crates:
|
||||
|
||||
```mist
|
||||
// Global include (C-style)
|
||||
#include <stdio.h>
|
||||
|
||||
// Use include (import from crate)
|
||||
pub use my_crate::my_module;
|
||||
|
||||
// Local include (import from relative path)
|
||||
#include "my_local_module.mist"
|
||||
```
|
||||
|
||||
Include directives allow you to bring in external code without using the module system, which is useful for C interop and local file organization.
|
||||
|
||||
### Module Resolution
|
||||
|
||||
Mist maps the module tree to Rust's module system:
|
||||
|
||||
Reference in New Issue
Block a user