Macro pest::parses_to [] [src]

macro_rules! parses_to {
    ( parser: $parser:ident, input: $string:expr, rule: $rules:tt :: $rule:tt,
      tokens: [ $( $names:ident $calls:tt ),* ] ) => { ... };
}

A macro which facilitates grammar testing and debugging by comparing produced tokens.

Examples

parses_to! {
    parser: AbcParser,
    input:  "abcde",
    rule:   Rule::a,
    tokens: [
        a(0, 3, [
            b(1, 2)
        ]),
        c(4, 5)
    ]
};