Skip to main content

unescape_unquote_string

Function unescape_unquote_string 

Source
pub fn unescape_unquote_string(
    bytes: &[u8],
    span: Span,
) -> (String, Option<ParseError>)
Expand description

Unescapes and unquotes a string, returning the content and any parse errors.

This function handles both quoted and unquoted strings, processing POSIX escape sequences only within double-quoted strings. Single-quoted and unquoted strings are returned as-is after removing their delimiters.

ยงReturns

A tuple of (unescaped_string, parse_error) where:

  • unescaped_string contains the processed content
  • parse_error is Some if an invalid escape sequence was encountered, None otherwise