organic/src/parser/affiliated_keyword.rs

55 lines
1.4 KiB
Rust
Raw Normal View History

use std::collections::BTreeMap;
use crate::context::GlobalSettings;
use crate::types::AffiliatedKeywordValue;
use crate::types::AffiliatedKeywords;
2023-10-11 11:17:01 -04:00
use crate::types::Keyword;
use crate::types::Object;
use crate::types::PlainList;
pub(crate) fn parse_affiliated_keywords<'g, 's>(
global_settings: &'g GlobalSettings<'g, 's>,
input: Vec<Keyword<'s>>,
) -> AffiliatedKeywords<'s> {
let mut ret = BTreeMap::new();
for kw in input.into_iter() {
// foo
}
AffiliatedKeywords { keywords: ret }
}
2023-10-11 11:17:57 -04:00
// pub struct AffiliatedKeyword<'s> {
// name: &'s str,
// }
// pub enum AffiliatedKeywordValue<'s> {
// SingleString(&'s str),
// ListOfStrings(Vec<&'s str>),
// ListOfObjects(Vec<Object<'s>>),
// }
// pub trait GetAffiliatedKeywords<'s> {
// type ItemIterator: Iterator<Item = &'s Keyword<'s>>;
// fn get_affiliated_keywords<'r: 's>(&'r self) -> Self::ItemIterator;
// }
// pub trait HandleAffiliatedKeywords<'s> {
// fn get_stuff(&self) -> &'s str;
// }
// impl<'s> GetAffiliatedKeywords<'s> for PlainList<'s> {
// type ItemIterator = std::slice::Iter<'s, Keyword<'s>>;
// fn get_affiliated_keywords<'r: 's>(&'r self) -> Self::ItemIterator {
// self.affiliated_keywords.iter()
// }
// }
// impl<'s, I: GetAffiliatedKeywords<'s>> HandleAffiliatedKeywords<'s> for I {
// fn get_stuff(&self) -> &'s str {
// self.get_affiliated_keywords().count();
// todo!()
// }
// }