Implement plain list.
This commit is contained in:
parent
cdf87641c5
commit
0edf5620a2
@ -6,13 +6,17 @@ use super::macros::to_wasm;
|
|||||||
use super::to_wasm::ToWasm;
|
use super::to_wasm::ToWasm;
|
||||||
use super::AdditionalProperties;
|
use super::AdditionalProperties;
|
||||||
use crate::compare::ElispFact;
|
use crate::compare::ElispFact;
|
||||||
|
use crate::types::GetAffiliatedKeywords;
|
||||||
use crate::types::PlainList;
|
use crate::types::PlainList;
|
||||||
|
use crate::types::PlainListType;
|
||||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct WasmPlainList {
|
pub struct WasmPlainList {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub(crate) additional_properties: AdditionalProperties,
|
pub(crate) additional_properties: AdditionalProperties,
|
||||||
|
#[serde(rename = "type")]
|
||||||
|
pub(crate) list_type: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
to_wasm!(
|
to_wasm!(
|
||||||
@ -21,8 +25,12 @@ to_wasm!(
|
|||||||
original,
|
original,
|
||||||
wasm_context,
|
wasm_context,
|
||||||
{ WasmAstNode::PlainList(original) },
|
{ WasmAstNode::PlainList(original) },
|
||||||
{ "TODO".into() },
|
{ "plain-list".into() },
|
||||||
{
|
{
|
||||||
|
let additional_properties = original
|
||||||
|
.get_affiliated_keywords()
|
||||||
|
.to_wasm(wasm_context.clone())?;
|
||||||
|
|
||||||
let children = original
|
let children = original
|
||||||
.children
|
.children
|
||||||
.iter()
|
.iter()
|
||||||
@ -36,7 +44,13 @@ to_wasm!(
|
|||||||
Ok((
|
Ok((
|
||||||
children,
|
children,
|
||||||
WasmPlainList {
|
WasmPlainList {
|
||||||
additional_properties: AdditionalProperties::default(),
|
additional_properties,
|
||||||
|
list_type: match original.list_type {
|
||||||
|
PlainListType::Unordered => "unordered",
|
||||||
|
PlainListType::Ordered => "ordered",
|
||||||
|
PlainListType::Descriptive => "descriptive",
|
||||||
|
}
|
||||||
|
.to_owned(),
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user