parse

Function parse 

Source
pub fn parse<'a>(
    rule: &str,
    input: &'a str,
) -> Result<Pair<'a, Rule>, ParseError>
Expand description

Parses the input with a specific rule.

§Arguments

  • rule - The name of the rule to parse (as a string).
  • input - The input string to parse.

§Returns

  • Ok<Pair> if the input matches the specified rule.
  • Err(ParseError) if the parsing fails or the rule is invalid.