diff options
-rw-r--r-- | src/tokens.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tokens.rs b/src/tokens.rs index 064c804..6413ce1 100644 --- a/src/tokens.rs +++ b/src/tokens.rs @@ -336,11 +336,14 @@ impl<'a> Tokenizer<'a> { } Some((i, ch)) if ch == delim => { if multiline { - for _ in 0..2 { - if !self.eatc(delim) { - val.push(delim); - continue 'outer; - } + if !self.eatc(delim) { + val.push(delim); + continue 'outer; + } + if !self.eatc(delim) { + val.push(delim); + val.push(delim); + continue 'outer; } } return Ok(String { @@ -630,6 +633,7 @@ mod tests { t(r#""\"a""#, "\"a", false); t("\"\"\"\na\"\"\"", "a", true); t("\"\"\"\n\"\"\"", "", true); + t(r#""""a\"""b""""#, "a\"\"\"b", true); err(r#""\a"#, Error::InvalidEscape(2, 'a')); err("\"\\\n", Error::InvalidEscape(2, '\n')); err("\"\\\r\n", Error::InvalidEscape(2, '\n')); |