pub struct Parser<'a> { /* private fields */ }

Implementations§

Parses a file.

Returns a GreenId of a node with an Item.* kind (see cairo_lang_syntax::node::ast::Item). If can’t parse as a top level item, keeps skipping tokens until it can. Returns None only when it reaches EOF.

Returns a GreenId of a node with a TraitItem.* kind (see cairo_lang_syntax::node::ast::TraitItem).

Returns a GreenId of a node with an Expr.* kind (see cairo_lang_syntax::node::ast::Expr) or a node with kind ExprMissing if an expression can’t be parsed.

Returns a GreenId of a node with a MatchArm kind or None if a match arm can’t be parsed.

Returns a GreenId of a node with a Statement.* kind (see cairo_lang_syntax::node::ast::Statement) or None if a statement can’t be parsed.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.