Taking into account additional property names but not comparing their values.
This commit is contained in:
27
src/wasm/additional_property.rs
Normal file
27
src/wasm/additional_property.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use super::WasmAstNode;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub enum AdditionalPropertyValue<'s, 'p> {
|
||||
SingleString(&'s str),
|
||||
ListOfStrings(Vec<&'s str>),
|
||||
OptionalPair {
|
||||
optval: Option<&'s str>,
|
||||
val: &'s str,
|
||||
},
|
||||
ObjectTree(Vec<(Option<Vec<WasmAstNode<'s, 'p>>>, Vec<WasmAstNode<'s, 'p>>)>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Default)]
|
||||
pub struct AdditionalProperties<'s, 'p> {
|
||||
pub(crate) properties: HashMap<String, AdditionalPropertyValue<'s, 'p>>,
|
||||
}
|
||||
|
||||
impl<'s, 'p> AdditionalProperties<'s, 'p> {
|
||||
pub(crate) fn get_elisp_names<'c>(&'c self) -> impl Iterator<Item = String> + 'c {
|
||||
self.properties.keys().map(move |key| format!(":{}", key))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user