[−][src]Macro pest::parses_to
Testing tool that compares produced tokens.
This macro takes several arguments:
parser- name of the data structure implementingParserinput- input to be tested againstrule-Rulewhich will be runtokens- token pairs of the formname(start_pos, end_pos, [nested_child_tokens])
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) ] };