ParserGroup

Trait ParserGroup 

Source
pub trait ParserGroup: Database {
    // Provided methods
    fn file_syntax<'db>(
        &'db self,
        file_id: FileId<'db>,
    ) -> Maybe<SyntaxNode<'db>> { ... }
    fn file_module_syntax<'db>(
        &'db self,
        file_id: FileId<'db>,
    ) -> Maybe<SyntaxFile<'db>> { ... }
    fn file_expr_syntax<'db>(
        &'db self,
        file_id: FileId<'db>,
    ) -> Maybe<Expr<'db>> { ... }
    fn file_statement_list_syntax<'db>(
        &'db self,
        file_id: FileId<'db>,
    ) -> Maybe<StatementList<'db>> { ... }
    fn file_syntax_diagnostics<'db>(
        &'db self,
        file_id: FileId<'db>,
    ) -> &'db Diagnostics<'db, ParserDiagnostic<'db>> { ... }
}
Expand description

Interface of the parser database.

Provided Methods§

Source

fn file_syntax<'db>(&'db self, file_id: FileId<'db>) -> Maybe<SyntaxNode<'db>>

Parses a file and returns its AST as a root SyntaxNode.

Source

fn file_module_syntax<'db>( &'db self, file_id: FileId<'db>, ) -> Maybe<SyntaxFile<'db>>

Parses a file and returns its AST as a root SyntaxFile.

Source

fn file_expr_syntax<'db>(&'db self, file_id: FileId<'db>) -> Maybe<Expr<'db>>

Parses a file and returns its AST as an expression. Only used for inline macros expanded code.

Source

fn file_statement_list_syntax<'db>( &'db self, file_id: FileId<'db>, ) -> Maybe<StatementList<'db>>

Parses a file and returns its AST as a list of statements. Only used for inline macros expanded code.

Source

fn file_syntax_diagnostics<'db>( &'db self, file_id: FileId<'db>, ) -> &'db Diagnostics<'db, ParserDiagnostic<'db>>

Returns the parser diagnostics for this file.

Implementors§