Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Dec 8, 2024
1 parent 3a7d0d5 commit 89b2949
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl CompilationUnit {
self.files.get(id).cloned()
}

fn bindings(&self) -> &Bindings {
pub fn binding_graph(&self) -> &Bindings {
self.bindings.get_or_init(|| {
let resolver = Resolver {
files: self.files.clone(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface bindings {
resource binding-graph {
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
interface compilation {
use bindings.{binding-graph};
use cst.{node, cursor};

/// A builder for creating compilation units.
Expand Down Expand Up @@ -42,6 +43,13 @@ interface compilation {

/// Returns the file with the specified ID, if it exists.
file: func(id: string) -> option<file>;

/// Calculates name binding information for all source files within the compilation unit.
/// Returns a graph that contains all found definitions and their references.
///
/// Note: building this graph is an expensive operation.
/// It is done lazily on the first access, and cached thereafter.
binding-graph: func() -> binding-graph;
}

/// A single source file in the compilation unit.
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.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nomic-foundation:slang;

world slang {
export ast;
export bindings;
export compilation;
export cst;
export parser;
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.

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 89b2949

Please sign in to comment.