From e7742b529a0c11c839e8cde6ace85e9842c98041 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 30 Dec 2023 16:18:08 -0500 Subject: [PATCH] Implement export snippet. --- src/wasm/export_snippet.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wasm/export_snippet.rs b/src/wasm/export_snippet.rs index ef03374b..ad0e6759 100644 --- a/src/wasm/export_snippet.rs +++ b/src/wasm/export_snippet.rs @@ -4,15 +4,15 @@ use serde::Serialize; use super::ast_node::WasmAstNode; use super::macros::to_wasm; use super::to_wasm::ToWasm; -use super::AdditionalProperties; use crate::compare::ElispFact; use crate::types::ExportSnippet; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize, Deserialize)] pub struct WasmExportSnippet { - #[serde(flatten)] - pub(crate) additional_properties: AdditionalProperties, + #[serde(rename = "back-end")] + pub(crate) backend: String, + pub(crate) value: Option, } to_wasm!( @@ -21,12 +21,13 @@ to_wasm!( original, wasm_context, { WasmAstNode::ExportSnippet(original) }, - { "TODO".into() }, + { "export-snippet".into() }, { Ok(( Vec::new(), WasmExportSnippet { - additional_properties: AdditionalProperties::default(), + backend: original.backend.to_owned(), + value: original.contents.map(|s| s.to_owned()), }, )) }