use super::iter::*;
use crate::ast::{
node::{NodeRef, SubNodeRef},
Ast,
};
impl Ast {
pub fn coarse_path_to(&self, offset: u32) -> AstPathIter<'_> {
AstPathIter::from_ast(self, offset)
}
pub fn fine_path_to(&self, offset: u32) -> AstFinePathIter<'_> {
AstFinePathIter::from_ast(self, offset)
}
pub fn coarse_find_node(&self, offset: u32) -> Option<NodeRef<'_>> {
self.coarse_path_to(offset).last()
}
pub fn fine_find_node(&self, offset: u32) -> Option<SubNodeRef<'_>> {
self.fine_path_to(offset).last()
}
}