Skip to main content

grammar_check

Function grammar_check 

Source
pub fn grammar_check(
    cx: &mut Cx,
    shape: &dyn Shape,
    codec: &Symbol,
    text: &str,
    position: DecodePosition,
) -> Result<GrammarCheck>
Expand description

Decode text with codec, then check the decoded syntax against shape.

Decode errors are reported as an unaccepted GrammarCheck instead of escaping as errors, so callers can feed the report into a repair loop. Runtime lookup errors and Shape implementation errors still return Err.