[][src]Trait silkworm_syn::parse::Parse

pub trait Parse: Sized + Sealed {
    fn partial_parse_with_ctx<I: IntoIterator<Item = Token>>(
        partial: bool,
        ctx: ParseCtx,
        token_stream: I
    ) -> Result<Self, ()>; fn parse_with_ctx<I: IntoIterator<Item = Token>>(
        ctx: ParseCtx,
        token_stream: I
    ) -> Result<Self, ()> { ... }
fn partial_parse_with_interner(
        partial: bool,
        source: &str,
        span_base: u32,
        interner: &mut Interner
    ) -> Result<Self, Vec<Error>> { ... }
fn parse_with_interner(
        source: &str,
        span_base: u32,
        interner: &mut Interner
    ) -> Result<Self, Vec<Error>> { ... }
fn partial_parse(
        partial: bool,
        source: &str,
        span_base: u32
    ) -> Result<(Self, Interner), Vec<Error>> { ... }
fn parse(
        source: &str,
        span_base: u32
    ) -> Result<(Self, Interner), Vec<Error>> { ... } }

Trait for AST types that can be parsed.

Required methods

fn partial_parse_with_ctx<I: IntoIterator<Item = Token>>(
    partial: bool,
    ctx: ParseCtx,
    token_stream: I
) -> Result<Self, ()>

Parse an AST node with a shared parsing context. Errors are emitted into ctx.

This emits an error if partial is false and the input is not completely consumed.

Loading content...

Provided methods

fn parse_with_ctx<I: IntoIterator<Item = Token>>(
    ctx: ParseCtx,
    token_stream: I
) -> Result<Self, ()>

Parse an AST node with a shared parsing context. Errors are emitted into ctx.

This emits an error if the input is not completely consumed.

fn partial_parse_with_interner(
    partial: bool,
    source: &str,
    span_base: u32,
    interner: &mut Interner
) -> Result<Self, Vec<Error>>

Convenience method for parsing source without a shared context. Errors are returned in the Err variant.

This emits an error if partial is false and the input is not completely consumed.

Errors

If any errors are emitted by the parser.

fn parse_with_interner(
    source: &str,
    span_base: u32,
    interner: &mut Interner
) -> Result<Self, Vec<Error>>

Convenience method for parsing source without a shared context. Errors are returned in the Err variant.

This emits an error if the input is not completely consumed.

Errors

If any errors are emitted by the parser.

fn partial_parse(
    partial: bool,
    source: &str,
    span_base: u32
) -> Result<(Self, Interner), Vec<Error>>

Convenience method for parsing source without a shared context. Errors are returned in the Err variant.

Symbols will be interned using a new interner, which will be returned on success.

This emits an error if partial is false and the input is not completely consumed.

Errors

If any errors are emitted by the parser.

fn parse(source: &str, span_base: u32) -> Result<(Self, Interner), Vec<Error>>

Convenience method for parsing source without a shared context. Errors are returned in the Err variant.

Symbols will be interned using a new interner, which will be returned on success.

This emits an error if the input is not completely consumed.

Errors

If any errors are emitted by the parser.

Loading content...

Implementors

impl Parse for FlowTarget[src]

impl Parse for FormatFuncArgKey[src]

impl Parse for NodeHeader[src]

impl Parse for StrSegment[src]

impl Parse for Command[src]

impl Parse for Expr[src]

impl Parse for File[src]

impl Parse for Flow[src]

impl Parse for FormatFunc[src]

impl Parse for FormatFuncArg[src]

impl Parse for Hashtag[src]

impl Parse for Lit[src]

impl Parse for Meta[src]

impl Parse for Node[src]

impl Parse for Path[src]

impl Parse for Pragma[src]

impl Parse for ShortcutOption[src]

impl Parse for Stmt[src]

impl Parse for StmtBody[src]

impl Parse for StrBody[src]

impl Parse for Text[src]

impl Parse for Var[src]

Loading content...