From 8bcc8ad0924012c7f9fede1bdd72eb5178fa8662 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 19 Dec 2023 10:50:07 +0100 Subject: [PATCH] Fix some lints --- .../user-guide/npm-package/how-to-parse-a-file/index.md | 2 +- .../user-guide/rust-crate/how-to-parse-a-file/index.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/public/user-guide/npm-package/how-to-parse-a-file/index.md b/documentation/public/user-guide/npm-package/how-to-parse-a-file/index.md index 691c79d833..b505b8042d 100644 --- a/documentation/public/user-guide/npm-package/how-to-parse-a-file/index.md +++ b/documentation/public/user-guide/npm-package/how-to-parse-a-file/index.md @@ -9,7 +9,7 @@ A file has to be parsed according to a specific Solidity [version](../../../soli Start by adding the Slang package as a dependency to your project: ```bash -$ npm install "@nomicfoundation/slang" +npm install "@nomicfoundation/slang" ``` Using the API directly provides us with a more fine-grained control over the parsing process; we can parse individual rules like contracts, various definitions or even expressions. diff --git a/documentation/public/user-guide/rust-crate/how-to-parse-a-file/index.md b/documentation/public/user-guide/rust-crate/how-to-parse-a-file/index.md index 622118cb60..f82accf3d4 100644 --- a/documentation/public/user-guide/rust-crate/how-to-parse-a-file/index.md +++ b/documentation/public/user-guide/rust-crate/how-to-parse-a-file/index.md @@ -10,7 +10,7 @@ After installing our CLI, you should now have `slang_solidity` in your $PATH. By Usage: -``` +```bash slang_solidity parse [--json] --version ``` @@ -75,8 +75,8 @@ This command parses the Solidity file and outputs the resulting CST in JSON form Next, let's inspect the tokens in the JSON output: ```bash -$ JQ_QUERY='recurse | select(.Token?) | .Token' -$ cat output.json | jq "$JQ_QUERY" +JQ_QUERY='recurse | select(.Token?) | .Token' +cat output.json | jq "$JQ_QUERY" ``` This gives us a flat list of the Token nodes: @@ -181,7 +181,7 @@ $ slang_solidity parse --json --version "$VERSION" file.sol | jq "$JQ_QUERY" The Rust package is a regular crate published to crates.io, so we can add it to a project as a dependency with: ```bash -$ cargo add slang_solidity +cargo add slang_solidity ``` Using the API directly provides us with a more fine-grained control over the parsing process. We're not limited to parsing the input as a top-level source unit but we can parse individual rules like contracts, various definitions or even expressions.