Skip to main content

split_grammar_source

Function split_grammar_source 

Source
pub fn split_grammar_source(
    source: &str,
    format: &str,
    names: &[&str],
) -> Result<GrammarSourceSplit, GrammarLosslessError>
Expand description

Splits source into the text before the first rule definition and the definitions of the rules in names, each with the text after it.

ยงErrors

Returns GrammarLosslessError::UnsupportedFormat for a format outside GRAMMAR_LOSSLESS_FORMATS and a layout error for malformed JSON.