Implement fixed width area.
This commit is contained in:
parent
0897061ff6
commit
fa31b001f4
@ -7,12 +7,14 @@ use super::to_wasm::ToWasm;
|
|||||||
use super::AdditionalProperties;
|
use super::AdditionalProperties;
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
use crate::types::FixedWidthArea;
|
use crate::types::FixedWidthArea;
|
||||||
|
use crate::types::GetAffiliatedKeywords;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct WasmFixedWidthArea {
|
pub struct WasmFixedWidthArea {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub(crate) additional_properties: AdditionalProperties,
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
|
pub(crate) value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
@ -21,12 +23,19 @@ to_wasm!(
|
|||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
{ WasmAstNode::FixedWidthArea(original) },
|
{ 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((
|
Ok((
|
||||||
Vec::new(),
|
Vec::new(),
|
||||||
WasmFixedWidthArea {
|
WasmFixedWidthArea {
|
||||||
additional_properties: AdditionalProperties::default(),
|
additional_properties,
|
||||||
|
value,
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ fn compare_json_value<'b, 's>(
|
|||||||
(serde_json::Value::Object(w), Token::TextWithProperties(e)) if is_plain_text(w) => {
|
(serde_json::Value::Object(w), Token::TextWithProperties(e)) if is_plain_text(w) => {
|
||||||
compare_plain_text(source, e, 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::Atom(_)) => todo!(),
|
||||||
(serde_json::Value::Null, Token::List(_)) => todo!(),
|
(serde_json::Value::Null, Token::List(_)) => todo!(),
|
||||||
(serde_json::Value::Null, Token::TextWithProperties(_)) => 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"),
|
(emacs_standard_properties.post_blank, "post-blank"),
|
||||||
] {
|
] {
|
||||||
match (emacs_value, wasm_standard_properties.get(wasm_name)) {
|
match (emacs_value, wasm_standard_properties.get(wasm_name)) {
|
||||||
(None, None) => {}
|
(None, None) | (None, Some(serde_json::Value::Null)) => {}
|
||||||
(None, Some(_)) => {
|
(None, Some(_)) => {
|
||||||
layer.status.push(WasmDiffStatus::Bad(
|
layer.status.push(WasmDiffStatus::Bad(
|
||||||
format!(
|
format!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user