mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00
added \r and \0 escape sequences
This commit is contained in:
parent
07a443a60b
commit
22b4ace81b
@ -501,16 +501,20 @@ pub mod implementation {
|
|||||||
match file.next() {
|
match file.next() {
|
||||||
Some('\\') => {
|
Some('\\') => {
|
||||||
if let Some(ch) = file.next() {
|
if let Some(ch) = file.next() {
|
||||||
buf.push(match ch {
|
buf.push(
|
||||||
|
match ch {
|
||||||
'\\' => '\\',
|
'\\' => '\\',
|
||||||
|
'r' => '\r',
|
||||||
'n' => '\n',
|
'n' => '\n',
|
||||||
't' => '\t',
|
't' => '\t',
|
||||||
|
'0' => '\0',
|
||||||
'"' => '"',
|
'"' => '"',
|
||||||
ch => {
|
ch => {
|
||||||
eprintln!("Warn: Weird char escape \"\\{ch}\", will be replaced with \"{ch}\".");
|
eprintln!("Warn: Weird char escape \"\\{ch}\", will be replaced with \"{ch}\".");
|
||||||
ch
|
ch
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some('"') => break,
|
Some('"') => break,
|
||||||
|
Loading…
Reference in New Issue
Block a user