Implement fixed width area.

This commit is contained in:
Tom Alexander 2023-12-29 19:21:35 -05:00
parent 0897061ff6
commit fa31b001f4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 13 additions and 3 deletions

View File

@ -7,12 +7,14 @@ use super::to_wasm::ToWasm;
use super::AdditionalProperties;
use crate::compare::ElispFact;
use crate::types::FixedWidthArea;
use crate::types::GetAffiliatedKeywords;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmFixedWidthArea {
#[serde(flatten)]
pub(crate) additional_properties: AdditionalProperties,
pub(crate) value: String,
}
to_wasm!(
@ -21,12 +23,19 @@ to_wasm!(
original,
wasm_context,
{ WasmAstNode::FixedWidthArea(original) },
{ "TODO".into() },
{ "fixed-width".into() },
{
let additional_properties = original
.get_affiliated_keywords()
.to_wasm(wasm_context.clone())?;
let value = original.get_value();
Ok((
Vec::new(),
WasmFixedWidthArea {
additional_properties: AdditionalProperties::default(),
additional_properties,
value,
},
))
}

View File

@ -57,6 +57,7 @@ fn compare_json_value<'b, 's>(
(serde_json::Value::Object(w), Token::TextWithProperties(e)) if is_plain_text(w) => {
compare_plain_text(source, e, w)
}
(serde_json::Value::Null, Token::Atom("nil")) => Ok(WasmDiffResult::default()),
(serde_json::Value::Null, Token::Atom(_)) => todo!(),
(serde_json::Value::Null, Token::List(_)) => todo!(),
(serde_json::Value::Null, Token::TextWithProperties(_)) => todo!(),
@ -213,7 +214,7 @@ fn compare_ast_node<'e, 's, 'w>(
(emacs_standard_properties.post_blank, "post-blank"),
] {
match (emacs_value, wasm_standard_properties.get(wasm_name)) {
(None, None) => {}
(None, None) | (None, Some(serde_json::Value::Null)) => {}
(None, Some(_)) => {
layer.status.push(WasmDiffStatus::Bad(
format!(