Skip to content

Commit

Permalink
Replace old resolver with database resolver
Browse files Browse the repository at this point in the history
The database resolver will resolve all references at once by using a database of
minimal partial paths.
  • Loading branch information
ggiraldez committed Dec 19, 2024
1 parent 2a9764b commit 8046c10
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 550 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ impl CompilationUnit {
binding_graph.add_user_file(id, file.create_tree_cursor());
}

binding_graph.resolve();

Ok(Rc::new(binding_graph))
})
}
Expand Down
7 changes: 1 addition & 6 deletions crates/metaslang/bindings/generated/public_api.txt

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

6 changes: 4 additions & 2 deletions crates/metaslang/bindings/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ pub enum BuildError {
MissingSymbol(GraphNodeRef),
#[error("Missing ‘scope’ attribute on graph node")]
MissingScope(GraphNodeRef),
#[error("Missing ‘definiens’ attribute on graph node")]
MissingDefiniens(GraphNodeRef),
#[error("Unknown ‘{0}’ flag type {1}")]
UnknownFlagType(String, String),
#[error("Unknown node type {0}")]
Expand Down Expand Up @@ -892,9 +894,9 @@ impl<'a, KT: KindTypes> Builder<'a, KT> {
Some(definiens_node) => {
let syntax_node_ref = definiens_node.as_syntax_node_ref()?;
let definiens_node = &self.graph[syntax_node_ref];
Some(definiens_node.clone())
definiens_node.clone()
}
None => None,
None => return Err(BuildError::MissingDefiniens(node_ref)),
};

let extension_scope = match node.attributes.get(EXTENSION_SCOPE_ATTR) {
Expand Down
309 changes: 0 additions & 309 deletions crates/metaslang/bindings/src/database.rs

This file was deleted.

Loading

0 comments on commit 8046c10

Please sign in to comment.