struct Ast {
keywords: Vec<Keyword>,
namespace: Option<Path>,
includes: Vec<LanguageLevelDecl>,
import: Vec<Import>,
features: Vec<Feature>,
constraints: Vec<ConstraintDecl>,
attributes: Vec<Attribute>,
references: Vec<Reference>,
groups: Vec<Group>,
dirs: Vec<Dir>,
structure: TreeMap,
index: HashMap<(Symbol, Ustr, SymbolKind), Symbol>,
}
Expand description
Ast container each symbol kind lives in its own vector
Fields§
§keywords: Vec<Keyword>
§namespace: Option<Path>
§includes: Vec<LanguageLevelDecl>
§import: Vec<Import>
§features: Vec<Feature>
§constraints: Vec<ConstraintDecl>
§attributes: Vec<Attribute>
§references: Vec<Reference>
§groups: Vec<Group>
§dirs: Vec<Dir>
§structure: TreeMap
§index: HashMap<(Symbol, Ustr, SymbolKind), Symbol>
Implementations§
source§impl Ast
impl Ast
pub fn import_prefix(&self, sym: Symbol) -> &[Ustr]
sourcefn lookup<F: FnMut(Symbol)>(&self, sym: Symbol, prefix: Ustr, f: F)
fn lookup<F: FnMut(Symbol)>(&self, sym: Symbol, prefix: Ustr, f: F)
call f for each child under sym and prefix
fn name(&self, sym: Symbol) -> Option<Ustr>
fn lsp_range(&self, sym: Symbol, source: &Rope) -> Option<Range>
fn children( &self, sym: Symbol, ) -> impl Iterator<Item = Symbol> + DoubleEndedIterator + '_
sourcefn all_imports(&self) -> impl Iterator<Item = Symbol> + DoubleEndedIterator
fn all_imports(&self) -> impl Iterator<Item = Symbol> + DoubleEndedIterator
utility iterators over different elements of interest
fn get_import(&self, index: usize) -> Option<&Import>
fn all_features(&self) -> impl Iterator<Item = Symbol>
fn get_feature(&self, index: usize) -> Option<&Feature>
fn containe_feature(&self, name: Ustr) -> bool
fn get_attribute(&self, index: usize) -> Option<&Attribute>
fn all_attributes(&self) -> impl Iterator<Item = Symbol>
fn containe_attribute(&self, name: Ustr) -> bool
fn all_references(&self) -> impl Iterator<Item = Symbol>
fn all_constraints(&self) -> impl Iterator<Item = Symbol>
fn all_lang_lvls(&self) -> impl Iterator<Item = Symbol>
fn find_all_of(&self, current: Symbol, name: Ustr) -> Vec<Symbol>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ast
impl RefUnwindSafe for Ast
impl Send for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnwindSafe for Ast
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more