Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add How-to guides on parsing Solidity for CLI/Rust/NPM #716

Merged
merged 5 commits into from
Dec 19, 2023

Conversation

Xanewok
Copy link
Contributor

@Xanewok Xanewok commented Dec 18, 2023

Closes #334

This adds a more hands-on intro to the parsing API and adds two examples on how to use it:

  • how to reconstruct the source: it's a kind of a "hello world" since you only visit and print the contents and it helps reinforce that the CST is, in fact, complete (wrt trivia)
  • how to list contracts and their names - it's simple, real worldsy and uses two different node kinds in a simple relationship.

This is done for Rust CLI, Rust library and the NPM package used as a library.

With this, we could probably get rid of the content from the respective index pages for Rust/NPM package and use this as the introductory first subpage as it overlaps with it now a bit.

Let me know if this is the direction we want to go in; didn't want to add more involved examples until I was sure that's what we want.

@Xanewok Xanewok requested a review from a team as a code owner December 18, 2023 14:57
Copy link

changeset-bot bot commented Dec 18, 2023

⚠️ No Changeset found

Latest commit: 3b1b6f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@OmarTawfik OmarTawfik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few suggestions.

crates/solidity/outputs/npm/tests/src/tests/cst-cursor.ts Outdated Show resolved Hide resolved
@Xanewok Xanewok enabled auto-merge December 19, 2023 12:30
@Xanewok Xanewok added this pull request to the merge queue Dec 19, 2023
Merged via the queue into NomicFoundation:main with commit 874ca24 Dec 19, 2023
1 check passed
@Xanewok Xanewok deleted the cursor-howto branch December 19, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide How Tos for the Cursor API
3 participants