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
21 lines
504 B
Plaintext
21 lines
504 B
Plaintext
error: empty character literal
|
|
--> $DIR/lex-bad-char-literals-7.rs:3:20
|
|
|
|
|
LL | let _: char = '';
|
|
| ^
|
|
|
|
error: empty unicode escape (must have at least 1 hex digit)
|
|
--> $DIR/lex-bad-char-literals-7.rs:5:20
|
|
|
|
|
LL | let _: char = '\u{}';
|
|
| ^^^^
|
|
|
|
error: unterminated character literal
|
|
--> $DIR/lex-bad-char-literals-7.rs:12:13
|
|
|
|
|
LL | let _ = ' hello // here's a comment
|
|
| ^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|