cairo_lang_parser::db

Trait ParserGroup

Source
pub trait ParserGroup:
    Database
    + HasQueryGroup<ParserDatabase>
    + SyntaxGroup
    + Upcast<dyn SyntaxGroup>
    + FilesGroup {
    // Required methods
    fn priv_file_syntax_data(&self, file_id: FileId) -> SyntaxData;
    fn file_syntax(&self, file_id: FileId) -> Maybe<SyntaxNode>;
    fn file_module_syntax(&self, file_id: FileId) -> Maybe<SyntaxFile>;
    fn file_expr_syntax(&self, file_id: FileId) -> Maybe<Expr>;
    fn file_syntax_diagnostics(
        &self,
        file_id: FileId,
    ) -> Diagnostics<ParserDiagnostic>;
}

Required Methods§

Source

fn priv_file_syntax_data(&self, file_id: FileId) -> SyntaxData

Should only be used internally. Parses a file and returns the result and the generated ParserDiagnostic.

Source

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

Parses a file and returns its SyntaxNode.

Source

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

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

Source

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

Parses a file and returns its AST as an expression.

Source

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

Returns the parser diagnostics for this file.

Implementors§

Source§

impl<DB> ParserGroup for DB
where DB: SyntaxGroup + Upcast<dyn SyntaxGroup> + FilesGroup + Database + HasQueryGroup<ParserDatabase>,