From c2f9789a641fa0bd3e8e85ab5585355341a7a6c7 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 29 Dec 2023 15:09:54 -0500 Subject: [PATCH] Placeholder for comparing quoted strings. --- src/wasm_test/compare.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/wasm_test/compare.rs b/src/wasm_test/compare.rs index aac61a2d..cfa65e7a 100644 --- a/src/wasm_test/compare.rs +++ b/src/wasm_test/compare.rs @@ -87,6 +87,12 @@ fn compare_json_value<'b, 's>( // We hit a regular ast node. compare_ast_node(source, el, wasm) } + (serde_json::Value::String(w), Token::Atom(e)) + if e.starts_with('"') && e.ends_with('"') => + { + // We hit a string compared against a quoted string from elisp (as opposed to an unquoted literal). + compare_quoted_string(source, e, w) + } (serde_json::Value::Null, Token::Atom(_)) => todo!(), (serde_json::Value::Null, Token::List(_)) => todo!(), (serde_json::Value::Null, Token::TextWithProperties(_)) => todo!(), @@ -235,6 +241,16 @@ fn wasm_key_to_emacs_key(wasm_key: WK) -> String { format!(":{key}", key = wasm_key) } +fn compare_quoted_string<'e, 's, 'w>( + source: &'s str, + emacs: &'e str, + wasm: &'w String, +) -> Result, Box> { + let mut result = WasmDiffResult::default(); + // TODO + Ok(result) +} + // pub fn old_wasm_compare_document<'b, 's, 'p>( // source: &'s str, // emacs: &'b Token<'s>,