Updated commands and export syntax
This commit is contained in:
@@ -30,6 +30,13 @@ pub i32 get_version() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also point to a specific point (super or crate, or a custom path):
|
||||||
|
```mist
|
||||||
|
pub(crate) i32 get_version() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Mutable Parameters
|
## Mutable Parameters
|
||||||
|
|
||||||
Parameters follow Rust’s ownership rules but use Mist’s local variable syntax. Use `mut` to allow a function to modify its local binding of a value.
|
Parameters follow Rust’s ownership rules but use Mist’s local variable syntax. Use `mut` to allow a function to modify its local binding of a value.
|
||||||
|
|||||||
+16
-13
@@ -72,26 +72,29 @@ void main() {
|
|||||||
|
|
||||||
### Build and Run
|
### Build and Run
|
||||||
|
|
||||||
To turn your Mist code into an executable, use the `build` command:
|
To turn your Mist code into an executable, use the `run` command:
|
||||||
|
|
||||||
```bash title="Terminal"
|
```bash title="Terminal"
|
||||||
mist build
|
mist run
|
||||||
```
|
|
||||||
|
|
||||||
Once the build is successful, you can run your program using standard Cargo commands:
|
|
||||||
|
|
||||||
```bash title="Terminal"
|
|
||||||
cargo run
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Pro Tip:** If you encounter any rust errors, head to the build directory and analyze the output, if you see anything unusual in the output, report the issue at https://github.com/mist-go/mist
|
> **Pro Tip:** If you encounter any rust errors, head to the build directory and analyze the output, if you see anything unusual in the output, report the issue at https://github.com/mist-go/mist
|
||||||
|
|
||||||
|
Or if you only want to transpile to rust
|
||||||
|
|
||||||
|
```bash title="Terminal"
|
||||||
|
mist transpile
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Command Reference
|
## Command Reference
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
| -------------- | ---------------------------------------------------------------- |
|
| ---------------- | ----------------------------------------------- |
|
||||||
| `mist build` | Compiles your `.mist` files into Rust code in the output folder. |
|
| `mist run` | Runs the project in the current directory |
|
||||||
| `mist version` | Displays the current version of the Mist compiler. |
|
| `mist build` | builds the project in the current directory |
|
||||||
| `mist help` | Stuck? Use this to see all available commands and options. |
|
| `mist transpile` | transpiles the project in the current directory |
|
||||||
|
| `mist version` | prints the compiler version |
|
||||||
|
| `mist help` | prints this message |
|
||||||
|
|||||||
Reference in New Issue
Block a user