Skip to main content

gbnf_string_literal

Function gbnf_string_literal 

Source
fn gbnf_string_literal(s: &str) -> Option<String>
Expand description

Render s as a GBNF double-quoted literal, escaping " and \.

Returns None for an empty string or one containing control bytes — markers a grammar cannot express verbatim make the caller fall back to unconstrained decode.