diff --git a/src/protocol/ast.rs b/src/protocol/ast.rs index 8de88d47194be4ef92063ac95d3e4139b4ee6db1..17a9f472f295125a32ff768347ad64352b79e20b 100644 --- a/src/protocol/ast.rs +++ b/src/protocol/ast.rs @@ -1220,6 +1220,14 @@ impl Root { } None } + pub fn get_definition_ident(&self, h: &Heap, id: &[u8]) -> Option { + for &def in self.definitions.iter() { + if h[h[def].identifier()].ident() == id { + return Some(def); + } + } + None + } pub fn get_declaration(&self, h: &Heap, id: IdentifierId) -> Option { for &decl in self.declarations.iter() { if h[h[decl].identifier()] == h[id] {