Conversation
|
1474582 to
7fa2407
Compare
937ddaa to
f6fafc0
Compare
- Consolidate the examples between Rust and TypeScript, to make it easier to update them together moving forward. - Use the same names and examples between languages. - Move all API references to [concepts.md], and keep the how-tos strictly focused on code. - remove a lot of duplicate code between the different examples. - hide useless/repetitive code that is for testing/infra, and only include user-facing snippets. - Show previous/next links between guides, to make it easier to read them in order. - Remove some of the useless [index.md] files, making sure sidebar navigation lists the following (in-order): - Introduction - Concepts - Rust Examples - TypeScript Examples Note: I suggest reviewing using `infra watch mkdocs` for this PR.
f6fafc0 to
98bc9fc
Compare
Xanewok
left a comment
There was a problem hiding this comment.
Thanks for unifying some of the snippets and related files! Most of the changes look good to me but I'd like to improve readability when using some snippets and try to find a better place for/reshuffle the API section.
documentation/public/user-guide/npm-package/using-the-parser.md
Outdated
Show resolved
Hide resolved
documentation/public/user-guide/npm-package/using-the-parser.md
Outdated
Show resolved
Hide resolved
documentation/public/user-guide/npm-package/using-the-cursor.md
Outdated
Show resolved
Hide resolved
documentation/public/user-guide/npm-package/using-the-cursor.md
Outdated
Show resolved
Hide resolved
7932d1d to
a29eb39
Compare
Xanewok
left a comment
There was a problem hiding this comment.
Great job! I'd probably come back and polish the concepts but this improves status quo, so let's land this 🎉
| ## Language Versions | ||
|
|
||
| To use Slang, you start by initializing a `Language` object with a specific version of the language. | ||
| The earliest Solidity version we support is `0.4.11`, and we plan on supporting all future versions as they are released. | ||
|
|
||
| From a `Language` object, you can analyze any source text according to the rules of that specific version. | ||
| Providing an accurate language version is important, as it affects the shape of the syntax tree, and possible errors produced. | ||
| You can use the `Language::getSupportedVersions()` API to get a list of all supported versions for the current Slang release. | ||
|
|
||
| The `Language::parse()` API is the main entry point for the parser, and to generate concrete syntax trees (CSTs) that can be used for further analysis. | ||
| Each `parse()` operation accepts the input source code, and a `RuleKind` variant. | ||
| This allows callers to parse entire source files (`RuleKind::SourceUnit`), individual contracts (`RuleKind::ContractDefinition`), | ||
| methods (`RuleKind::FunctionDefinition`), or any other syntax nodes. |
There was a problem hiding this comment.
I am still not sold on this, given how much there's code/blocks here and in the CST Cursors section and supporting multiple versions as an idea/concept is explained already in User Guide > Introduction.
I don't think this is also a good place to list all different kinds of node relationships the cursor can jump to (to give an example what I mean by a lot of code), but given how this PR improves multiple other different things, I don't want to block on this and we can try to make it clearer in a follow-up.
Note: I suggest reviewing using
infra watch mkdocsfor this PR.