From 22b4ace81b535de2a3697b8390989295b69628b2 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 23 May 2023 20:24:32 +0200 Subject: [PATCH] added \r and \0 escape sequences --- mers/src/parsing/parse.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mers/src/parsing/parse.rs b/mers/src/parsing/parse.rs index 2b74eac..246f677 100755 --- a/mers/src/parsing/parse.rs +++ b/mers/src/parsing/parse.rs @@ -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,