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>,