Implement entity.
This commit is contained in:
parent
e7742b529a
commit
ea000894f0
@ -2,17 +2,26 @@ use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::headline::Noop;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::Entity;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmEntity {
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
pub(crate) name: String,
|
||||
pub(crate) latex: String,
|
||||
#[serde(rename = "latex-math-p")]
|
||||
pub(crate) latex_math_mode: bool,
|
||||
pub(crate) html: String,
|
||||
pub(crate) ascii: String,
|
||||
pub(crate) latin1: Noop,
|
||||
#[serde(rename = "utf-8")]
|
||||
pub(crate) utf8: String,
|
||||
#[serde(rename = "use-brackets-p")]
|
||||
pub(crate) use_brackets: bool,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -21,12 +30,19 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::Entity(original) },
|
||||
{ "TODO".into() },
|
||||
{ "entity".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmEntity {
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
name: original.name.to_owned(),
|
||||
latex: original.latex.to_owned(),
|
||||
latex_math_mode: original.latex_math_mode,
|
||||
html: original.html.to_owned(),
|
||||
ascii: original.ascii.to_owned(),
|
||||
latin1: Noop {},
|
||||
utf8: original.utf8.to_owned(),
|
||||
use_brackets: original.use_brackets,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user