Implement comment.

This commit is contained in:
Tom Alexander 2023-12-29 21:59:45 -05:00
parent eb2995dd3b
commit cdf87641c5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 4 additions and 6 deletions

View File

@ -4,15 +4,13 @@ use serde::Serialize;
use super::ast_node::WasmAstNode; use super::ast_node::WasmAstNode;
use super::macros::to_wasm; use super::macros::to_wasm;
use super::to_wasm::ToWasm; use super::to_wasm::ToWasm;
use super::AdditionalProperties;
use crate::compare::ElispFact; use crate::compare::ElispFact;
use crate::types::Comment; use crate::types::Comment;
use crate::wasm::to_wasm::ToWasmStandardProperties; use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct WasmComment { pub struct WasmComment {
#[serde(flatten)] pub(crate) value: String,
pub(crate) additional_properties: AdditionalProperties,
} }
to_wasm!( to_wasm!(
@ -21,12 +19,12 @@ to_wasm!(
original, original,
wasm_context, wasm_context,
{ WasmAstNode::Comment(original) }, { WasmAstNode::Comment(original) },
{ "TODO".into() }, { "comment".into() },
{ {
Ok(( Ok((
Vec::new(), Vec::new(),
WasmComment { WasmComment {
additional_properties: AdditionalProperties::default(), value: original.get_value(),
}, },
)) ))
} }

View File

@ -34,7 +34,7 @@ to_wasm!(
Vec::new(), Vec::new(),
WasmKeyword { WasmKeyword {
additional_properties, additional_properties,
key: original.key.to_owned(), key: original.key.to_uppercase(),
value: original.value.to_owned(), value: original.value.to_owned(),
}, },
)) ))