Skip to main content

Parse

Trait Parse 

Source
pub trait Parse<'t> {
    type Prec: Copy + Default;

    // Required method
    fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>
       where Self: Sized;
}
Expand description

Parse an expression from a Parser’s token stream at a given precedence level

Required Associated Types§

Source

type Prec: Copy + Default

The possible precedence levels for this parser implementation

Required Methods§

Source

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>
where Self: Sized,

Parses Self from the tokens (and extra data) held in a Parser

Implementations on Foreign Types§

Source§

impl<'t> Parse<'t> for Bind

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>

Source§

impl<'t> Parse<'t> for Expr

Source§

fn parse(p: &mut Parser<'t>, level: usize) -> PResult<Self>

Parses an [Expr]ession.

The level parameter indicates the operator binding level of the expression.

Source§

type Prec = usize

Source§

impl<'t> Parse<'t> for Literal

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: ()) -> PResult<Self>

Source§

impl<'t> Parse<'t> for MakeArm

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: ()) -> PResult<Self>

Source§

impl<'t> Parse<'t> for Match

Parses a match expression

match scrutinee {
    (Pat => Expr);*
}
Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>
where Self: Sized,

Source§

impl<'t> Parse<'t> for MatchArm

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>
where Self: Sized,

Source§

impl<'t> Parse<'t> for Pat

Source§

type Prec = Prec

Source§

fn parse(p: &mut Parser<'t>, level: Prec) -> PResult<Self>

Source§

impl<'t> Parse<'t> for Path

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>

Source§

impl<'t> Parse<'t> for Use

Source§

type Prec = ()

Source§

fn parse(p: &mut Parser<'t>, _level: Self::Prec) -> PResult<Self>

Source§

impl<'t, P: Parse<'t> + AstNode> Parse<'t> for At<P>

Source§

type Prec = <P as Parse<'t>>::Prec

Source§

fn parse(p: &mut Parser<'t>, level: P::Prec) -> PResult<Self>
where Self: Sized,

Source§

impl<'t, P: Parse<'t>> Parse<'t> for Box<P>

Source§

type Prec = <P as Parse<'t>>::Prec

Source§

fn parse(p: &mut Parser<'t>, level: P::Prec) -> PResult<Self>
where Self: Sized,

Implementors§