about summary refs log tree commit diff
path: root/compiler/rustc_lexer/src/unescape
AgeCommit message (Collapse)AuthorLines
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-4/+2
2022-11-08Simplify `unescape_{char,byte}`.Nicholas Nethercote-8/+4
The `usize` isn't needed in the error case.
2022-11-05Remove `unescape_byte_literal`.Nicholas Nethercote-7/+5
It's easy to just use `unescape_literal` + `byte_from_char`.
2022-11-04Make non-ASCII errors more consistent.Nicholas Nethercote-5/+2
There are three kinds of "byte" literals: byte literals, byte string literals, and raw byte string literals. None are allowed to have non-ASCII chars in them. Two `EscapeError` variants exist for when that constraint is violated. - `NonAsciiCharInByte`: used for byte literals and byte string literals. - `NonAsciiCharInByteString`: used for raw byte string literals. As a result, the messages for raw byte string literals use different wording, without good reason. Also, byte string literals are incorrectly described as "byte constants" in some error messages. This commit eliminates `NonAsciiCharInByteString` so the three cases are handled similarly, and described correctly. The `mode` is enough to distinguish them. Note: Some existing error messages mention "byte constants" and some mention "byte literals". I went with the latter here, because it's a more correct name, as used by the Reference.
2021-08-11Warn when an escaped newline skips multiple linesAnton Golov-0/+5
2021-07-30Add warning when whitespace is not skipped after an escaped newline.Anton Golov-0/+19
2020-08-30mv compiler to compiler/mark-0/+273