1
Fork 0

introduce unescape module

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
This commit is contained in:
Aleksey Kladov 2019-04-25 11:48:25 +03:00
parent 9b67bd42b7
commit bfa5f27847
24 changed files with 1046 additions and 768 deletions

View file

@ -1,3 +1,4 @@
// compile-flags: -Z continue-parse-after-error
// ignore-tidy-tab
fn main() {
@ -76,7 +77,7 @@ raw { \n
println!("\x7B}\u8 {", 1);
//~^ ERROR incorrect unicode escape sequence
//~| ERROR argument never used
//~| ERROR invalid format string: expected `'}'` but string was terminated
// note: raw strings don't escape `\xFF` and `\u{FF}` sequences
println!(r#"\x7B}\u{8} {"#, 1);