ra_ap_rustc_lexer

Module unescape

Source
Expand description

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

Enums§

EscapeError
Errors and warnings that can occur during string unescaping. They mostly relate to malformed escape sequences, but there are a few that are about other problems.
MixedUnit
Used for mixed utf8 string literals, i.e. those that allow both unicode chars and high bytes.
Mode
What kind of literal do we parse.

Functions§

byte_from_char
unescape_byte
Takes a contents of a byte literal (without quotes), and returns an unescaped byte or an error.
unescape_char
Takes a contents of a char literal (without quotes), and returns an unescaped char or an error.
unescape_mixed
Takes the contents of a mixed-utf8 literal (without quotes) and produces a sequence of escaped characters or errors.
unescape_unicode
Takes the contents of a unicode-only (non-mixed-utf8) literal (without quotes) and produces a sequence of escaped characters or errors.