bfa5f27847
Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
45 lines
900 B
Plaintext
45 lines
900 B
Plaintext
error: unknown byte escape: f
|
|
--> $DIR/byte-literals.rs:6:21
|
|
|
|
|
LL | static FOO: u8 = b'\f';
|
|
| ^ unknown byte escape
|
|
|
|
error: unknown byte escape: f
|
|
--> $DIR/byte-literals.rs:9:8
|
|
|
|
|
LL | b'\f';
|
|
| ^ unknown byte escape
|
|
|
|
error: invalid character in numeric character escape: Z
|
|
--> $DIR/byte-literals.rs:10:10
|
|
|
|
|
LL | b'\x0Z';
|
|
| ^
|
|
|
|
error: byte constant must be escaped: \t
|
|
--> $DIR/byte-literals.rs:11:7
|
|
|
|
|
LL | b' ';
|
|
| ^^^^
|
|
|
|
error: byte constant must be escaped: '
|
|
--> $DIR/byte-literals.rs:12:7
|
|
|
|
|
LL | b''';
|
|
| ^
|
|
|
|
error: byte constant must be ASCII. Use a \xHH escape for a non-ASCII byte
|
|
--> $DIR/byte-literals.rs:13:7
|
|
|
|
|
LL | b'é';
|
|
| ^
|
|
|
|
error: unterminated byte constant
|
|
--> $DIR/byte-literals.rs:14:6
|
|
|
|
|
LL | b'a
|
|
| ^^^^
|
|
|
|
error: aborting due to 7 previous errors
|
|
|