pub fn opcode<I, O1, O2, E, P, Q>(
description: &'static str,
opcode_parser: P,
body_parser: Q,
) -> impl FnMut(I) -> IResult<I, O2, E>where
I: Clone,
P: Parser<I, O1, E>,
Q: Parser<I, O2, E>,
E: ParseError<I> + ContextError<I>,
Expand description
Combinator for productions that use a deterministic opcode
If a production is preceded by an unambiguous opcode, then we can avoid backtracking when parsing the rest. This enables better error messages in addition to faster parsing.