From 2e94a4217ba17e95a5547ec2157a65e89af83ce7 Mon Sep 17 00:00:00 2001 From: Ethiraric Date: Mon, 22 Jan 2024 22:56:18 +0100 Subject: [PATCH] Fix dquote string escape sequences. --- saphyr/src/scanner.rs | 2 +- saphyr/tests/yaml-test-suite.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/saphyr/src/scanner.rs b/saphyr/src/scanner.rs index b9d0f16..57a4295 100644 --- a/saphyr/src/scanner.rs +++ b/saphyr/src/scanner.rs @@ -1986,7 +1986,7 @@ impl> Scanner { 'e' => ret = '\x1b', ' ' => ret = '\x20', '"' => ret = '"', - '\'' => ret = '\'', + '/' => ret = '/', '\\' => ret = '\\', // Unicode next line (#x85) 'N' => ret = char::from_u32(0x85).unwrap(), diff --git a/saphyr/tests/yaml-test-suite.rs b/saphyr/tests/yaml-test-suite.rs index a1e421d..e4470ac 100644 --- a/saphyr/tests/yaml-test-suite.rs +++ b/saphyr/tests/yaml-test-suite.rs @@ -315,8 +315,6 @@ fn expected_events(expected_tree: &str) -> Vec { #[rustfmt::skip] static EXPECTED_FAILURES: &[&str] = &[ // Misc - "3UYS", // Escaped / - "HRE5", // Escaped ' in double-quoted (should not work) "QB6E", // Indent for multiline double-quoted scalar "S98Z", // Block scalar and indent problems? "U99R", // Comma is not allowed in tags