Function unescape_string

Source
pub fn unescape_string(pair: Pair<'_, Rule>) -> String
Expand description

Unescapes a quoted string literal, handling escape sequences.

§Arguments

  • pair - The pest pair containing the string to unescape (must be Rule::string_literal or Rule::quoted_name).

§Returns

  • String with the unescaped contents.

§Panics

Panics if the rule is not string_literal or quoted_name (this should never happen if the pest grammar is working correctly).