Struct piston_meta::Optional [] [src]

pub struct Optional {
    pub rule: Rule,
    pub debug_id: DebugId,
}

Stores information about optional.

Fields

rule: Rule

The optional rule.

debug_id: DebugId

A debug id to track down the rule generating an error.

Methods

impl Optional
[src]

fn parse(&self, tokenizer: &mut Tokenizer, state: &TokenizerState, chars: &[char], offset: usize) -> (Range, TokenizerState, Option<(Range, ParseError)>)

Parse optional. Returns the old state if any sub rule fails.