Struct reproto_semver::parser::Parser [] [src]

pub struct Parser<'input> { /* fields omitted */ }

A recursive-descent parser for parsing version requirements.

Methods

impl<'input> Parser<'input>
[src]

[src]

Construct a new parser for the given input.

[src]

Parse an optional comma separator, then if that is present a predicate.

[src]

Parse a single component.

Returns None if the component is a wildcard.

[src]

Parse a single numeric.

[src]

Optionally parse a dot, then a component.

The second component of the tuple indicates if a wildcard has been encountered, and is always false if the first component is Some.

If a dot is not encountered, (None, false) is returned.

If a wildcard is encountered, (None, true) is returned.

[src]

Parse a dot, then a numeric.

[src]

Parse an string identifier.

Like, foo, or bar.

[src]

Optionally parse a single operator.

Like, ~, or ^.

[src]

Parse a single predicate.

Like, ^1, or >=2.0.0.

[src]

Parse a single range.

Like, ^1.0 or >=3.0.0, <4.0.0.

[src]

Parse a version.

Like, 1.0.0 or 3.0.0-beta.1.

[src]

Check if we have reached the end of input.

[src]

Get the rest of the tokens in the parser.

Useful for debugging.