[][src]Macro pest::parses_to

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

Testing tool that compares produced tokens.

This macro takes several arguments:

Note: start_pos and end_pos are byte positions.

Examples

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