Skip to main content

parse_command_prefix_in

Function parse_command_prefix_in 

Source
pub fn parse_command_prefix_in(
    surface: &Surface,
    input: &str,
) -> Result<(Command, usize), ParseError>
Expand description

Parse ONE command off the FRONT of input, returning it with the number of bytes consumed.

This is the primitive both doors are built from: parse_command_in adds “and nothing followed”, and the document splitter loops it. Every branch reports its own extent — the literate parsers from their own cursor, the Coq-style ones from the sentence terminator — so no caller has to guess where a command ended.