Skip to content

Commit

Permalink
Improve documentation for binding-graph wit component
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiraldez committed Feb 7, 2025
1 parent 88197d0 commit 3304470
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ interface bindings {

/// A giant graph that contains name binding information for all source files within the compilation unit.
/// It stores cursors to all definitions and references, and can resolve the edges between them.
/// Most cursors pointing to identifier terminals will resolve to either a definition or a reference. For example, in `contract A is B {}` the cursor to identifier `A` will resolve to a definition, and the cursor to identifier `B` will resolve to a reference.
/// There is one specific case in which a cursor to an identifier resolves to both: a non-aliased symbol import `import {X} from "library"`, where the identifier `X` is both a definition and a reference (to the symbol exported from `"library"`).
/// Also, an identifier denoting a feature in a `pragma experimental` directive will not resolve to either.
resource binding-graph {
/// Tries to resolve the identifier terminal pointed at by the provided cursor to a definition.
/// If successful, returns the definition. Otherwise, returns `undefined`.
Expand Down Expand Up @@ -32,7 +35,7 @@ interface bindings {
/// For `contract X {}`, that is the location of the parent `ContractDefinition` node.
definiens-location: func() -> binding-location;

/// Returns a list of all references this definition binds to.
/// Returns a list of all references that bind to this definition.
references: func() -> list<reference>;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3304470

Please sign in to comment.