pub struct Parser<'a> {
    pub pos: usize,
    pub eaten: usize,
    /* private fields */
}
Expand description

Basic greedy parser with YAML syntax.

Its methods are actually the sub-parser of the syntax.

Fields

pos: usize

Current position.

eaten: usize

Read position.

Implementations

The implementation of the directives.

Match directives.

The low level grammar implementation for YAML.

These sub-parser returns Result<R, PError>, and calling Parser::backward if mismatched.

Match invisible boundaries and keep the gaps. (must matched once)

Match complex mapping indicator (?).

Match integer.

Match float.

Match float with scientific notation.

Match quoted string.

Match plain string.

Match literal string.

Match folded string.

Match chomping option.

Match wrapped string.

String escaping, return a new string.

Match valid YAML identifier.

Match tags.

Match anchor definition.

Match anchor used.

Match any invisible characters except newline.

Match newline characters.

Match any invisible characters.

Match and define new indent size.

Match indent with previous level.

This sub-parser returns true if downgrading indent is used.

The downgrading can only use a level as unit, not a whitespace.

Match any optional invisible characters between two lines.

Set cmt to true to ignore comments at the line end.

Match comment.

The implementation of string pointer.

Create a parser with the string.

Attach document on the parser.

Show the right hand side string after the current cursor.

Get the text from the eaten cursor to the current position.

The low level grammar implementation.

These sub-parser returns Result<(), PError>, and calling Parser::backward if mismatched.

Set the starting point if character boundary is valid.

Get the indicator.

A short function to raise error.

Consume and move the pointer.

Consume the eaten part.

Move the current position back.

Move back current cursor.

Match symbol.

Match symbol set.

Match symbol sequence.

Match until the condition failed.

The argument opt matches different terminate requirement.

Count the position that parser goes, expect error.

A wrapper for saving checkpoint locally.

A SET detector.

A NOT detector.

Match indent.

Trait Implementations

Returns the “default value” for a type. Read more

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.