added \r and \0 escape sequences

This commit is contained in:
mark 2023-05-23 20:24:32 +02:00
parent 07a443a60b
commit 22b4ace81b

View File

@ -501,16 +501,20 @@ pub mod implementation {
match file.next() {
Some('\\') => {
if let Some(ch) = file.next() {
buf.push(match ch {
buf.push(
match ch {
'\\' => '\\',
'r' => '\r',
'n' => '\n',
't' => '\t',
'0' => '\0',
'"' => '"',
ch => {
eprintln!("Warn: Weird char escape \"\\{ch}\", will be replaced with \"{ch}\".");
ch
},
})
}
)
}
}
Some('"') => break,