Struct biome_parser::AnyParse
source · pub struct AnyParse { /* private fields */ }Expand description
Language-independent cache entry for a parsed file
This struct holds a handle to the root node of the parsed syntax tree, along with the list of diagnostics emitted by the parser while generating this entry.
It can be dynamically downcast into a concrete SyntaxNode or AstNode of the corresponding language, generally through a language-specific capability
Implementations§
source§impl AnyParse
impl AnyParse
pub fn new( root: SendNode, diagnostics: Vec<ParseDiagnostic>, file_source: AnyFileSource ) -> AnyParse
pub fn syntax<L>(&self) -> SyntaxNode<L>where L: Language + 'static,
pub fn file_source<'a, F, L>( &self, path: &'a Path ) -> Result<F, FileSourceError>where F: FileSource<'a, L> + 'static, L: Language + 'static,
pub fn tree<N>(&self) -> Nwhere N: AstNode, N::Language: 'static,
sourcepub fn into_diagnostics(self) -> Vec<Diagnostic>
pub fn into_diagnostics(self) -> Vec<Diagnostic>
This function transforms diagnostics coming from the parser into serializable diagnostics
sourcepub fn diagnostics(&self) -> &[ParseDiagnostic]
pub fn diagnostics(&self) -> &[ParseDiagnostic]
Get the diagnostics which occurred when parsing
pub fn has_errors(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for AnyParse
impl Send for AnyParse
impl Sync for AnyParse
impl Unpin for AnyParse
impl UnwindSafe for AnyParse
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