Implement special block.
This commit is contained in:
		
							parent
							
								
									efc4a04829
								
							
						
					
					
						commit
						aa5629354e
					
				| @ -2,10 +2,12 @@ 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::GetAffiliatedKeywords; | ||||
| use crate::types::SpecialBlock; | ||||
| use crate::wasm::to_wasm::ToWasmStandardProperties; | ||||
| 
 | ||||
| @ -13,6 +15,10 @@ use crate::wasm::to_wasm::ToWasmStandardProperties; | ||||
| pub struct WasmSpecialBlock { | ||||
|     #[serde(flatten)] | ||||
|     pub(crate) additional_properties: AdditionalProperties, | ||||
|     #[serde(rename = "type")] | ||||
|     pub(crate) block_type: String, | ||||
|     pub(crate) parameters: Option<String>, | ||||
|     pub(crate) results: Noop, | ||||
| } | ||||
| 
 | ||||
| to_wasm!( | ||||
| @ -21,8 +27,12 @@ to_wasm!( | ||||
|     original, | ||||
|     wasm_context, | ||||
|     { WasmAstNode::SpecialBlock(original) }, | ||||
|     { "TODO".into() }, | ||||
|     { "special-block".into() }, | ||||
|     { | ||||
|         let additional_properties = original | ||||
|             .get_affiliated_keywords() | ||||
|             .to_wasm(wasm_context.clone())?; | ||||
| 
 | ||||
|         let children = original | ||||
|             .children | ||||
|             .iter() | ||||
| @ -36,7 +46,10 @@ to_wasm!( | ||||
|         Ok(( | ||||
|             children, | ||||
|             WasmSpecialBlock { | ||||
|                 additional_properties: AdditionalProperties::default(), | ||||
|                 additional_properties, | ||||
|                 block_type: original.block_type.to_owned(), | ||||
|                 parameters: original.parameters.map(|s| s.to_owned()), | ||||
|                 results: Noop {}, | ||||
|             }, | ||||
|         )) | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander