Struct piston_meta::Token [] [src]

pub struct Token {
    pub text: Rc<String>,
    pub inverted: bool,
    pub property: Option<Rc<String>>,
    pub debug_id: DebugId,
}

Stores information about token.

Fields

text: Rc<String>

The text to match against.

inverted: bool

Whether to set property to true or false (inverted).

property: Option<Rc<String>>

Which property to set if token matches.

debug_id: DebugId

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

Methods

impl Token
[src]

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

Parses token. If the token is linked to a property, the property will be set. If the meta reader fails setting the property the error is handled. If the token is not linked to any property, the same state will be returned.

Trait Implementations

impl Clone for Token
[src]

fn clone(&self) -> Token

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more