[][src]Module rustc_lexer::unescape

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Utilities for validating string and char literals and turning them into values they represent.

Enums

EscapeErrorInternal

Errors that can occur during string unescaping.

ModeInternal

What kind of literal do we parse.

Functions

byte_from_charInternal
is_asciiInternal
scan_escapeInternal
unescape_byteInternal

Takes a contents of a byte literal (without quotes), and returns an unescaped byte or an error.

unescape_byte_literalInternal

Takes a contents of a byte, byte string or raw byte string (without quotes) and produces a sequence of bytes or errors. Values are returned through invoking of the provided callback.

unescape_charInternal

Takes a contents of a char literal (without quotes), and returns an unescaped char or an error

unescape_char_or_byteInternal
unescape_literalInternal

Takes a contents of a literal (without quotes) and produces a sequence of escaped characters or errors. Values are returned through invoking of the provided callback.

unescape_raw_str_or_byte_strInternal

Takes a contents of a string literal (without quotes) and produces a sequence of characters or errors. NOTE: Raw strings do not perform any explicit character escaping, here we only translate CRLF to LF and produce errors on bare CR.

unescape_str_or_byte_strInternal

Takes a contents of a string literal (without quotes) and produces a sequence of escaped characters or errors.