diff --git a/content/docs/index.mdx b/content/docs/index.mdx index dc64003..184ff38 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -11,7 +11,7 @@ Mist is currently distributed as a Cargo crate. To get started, you'll need to h Run the following command to install the Mist compiler: ```bash title="Terminal" -cargo install mist-lang@0.0.2-alpha0 +cargo install mist-lang@0.0.3-alpha4 ``` Once the installation finishes, verify it by checking the version: @@ -52,11 +52,24 @@ Since Mist compiles down to Rust, you need to point Cargo to the generated outpu ```toml title="Cargo.toml" [[bin]] -name = "main" +name = "my-mist-app" path = "build/main.rs" ``` -> **Pro Tip:** You’ll probably want to add `/build` to your `.gitignore` file to keep your repository clean! +You can also add `/build` to your `.gitignore`. + +> **Pro Tip:** create a `src/_header.rs` file with only main declared, and add this to your `Cargo.toml` (without replacing the current `[[bin]]`): +> ```toml title="Cargo.toml" +> # add this in [package] +> default-run="my-mist-app-header" +> +> # Do not replace the current [[bin]] +> [[bin]] +> name = "my-mist-app-header" +> path = "src/_header.rs" +>``` +> +> And add all of the `mod`(s) from `src/main.rs`, as well as a empty `main` function, this will allow `.rs` files to be used with IDE support. --- @@ -78,9 +91,7 @@ To turn your Mist code into an executable, use the `run` command: mist 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 - -Or if you only want to transpile to rust +Or if you only want to transpile to rust (this will not give any semantic errors, only syntax errors). ```bash title="Terminal" mist transpile @@ -96,5 +107,6 @@ mist transpile | `mist run` | Runs the project in the current directory | | `mist build` | builds the project in the current directory | | `mist transpile` | transpiles the project in the current directory | +| `mist check` | checks the project in the current directory | | `mist version` | prints the compiler version | | `mist help` | prints this message | diff --git a/content/docs/logic/control-flow.mdx b/content/docs/logic/control-flow.mdx index d51c51a..8783892 100644 --- a/content/docs/logic/control-flow.mdx +++ b/content/docs/logic/control-flow.mdx @@ -32,6 +32,9 @@ match (task_state) { TaskState::Failed { reason, code } => { println!("Error {}: {}", code, reason); } + TaskState::NotResponding | TaskState::Progress => { + draw_loading(); + } _ => { println!("Other state"); }