Placeholder for comparing quoted strings.

This commit is contained in:
Tom Alexander 2023-12-29 15:09:54 -05:00
parent 579cbb5d11
commit c2f9789a64
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 16 additions and 0 deletions

View File

@ -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<WK: std::fmt::Display>(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<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
let mut result = WasmDiffResult::default();
// TODO
Ok(result)
}
// pub fn old_wasm_compare_document<'b, 's, 'p>(
// source: &'s str,
// emacs: &'b Token<'s>,