Skip to content

Conversation

@beta-ziliani
Copy link
Contributor

@beta-ziliani beta-ziliani commented Nov 11, 2025

To be merged on top of red-green-trees.

It adds as a test case in the cargo-sphere with the example from find-unused-definitions, but using the new binder and output from the backend.

Some functions are almost literal translations. For instance, collect_definitions still uses the cursor. Other functions exploit the information from a typed AST. visit_contract is a good example.

It adds a few helper functions:

  • Binder::navigate_to to flow from an identifier node id to a definition.
  • Definition::node to obtain the inner SyntaxNode.
  • SyntaxNode::create_cursor (self-described).
  • re-exports the ir2 intermediate language as ast in the backend mod.

NOTE: I screw my commits, so they're unparseable on their own. The best way to review it is to just focus on the test/src/ast_api folder.

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

⚠️ No Changeset found

Latest commit: 106cc61

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

@ggiraldez
Copy link
Contributor

Migrated to manastech#5 to keep track of the branch, because the dependant red-green-trees is not likely to be merged in the near future.

@ggiraldez ggiraldez closed this Dec 9, 2025
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.

2 participants