Lifetime issue.
This commit is contained in:
@@ -25,6 +25,22 @@ pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
||||
translated_name,
|
||||
AffiliatedKeywordValue::SingleString(kw.value),
|
||||
);
|
||||
} else if is_list_of_single_string_keyword(global_settings, translated_name.as_str()) {
|
||||
let list_of_strings = ret
|
||||
.entry(translated_name)
|
||||
.or_insert_with(|| AffiliatedKeywordValue::ListOfStrings(Vec::with_capacity(1)));
|
||||
match list_of_strings {
|
||||
AffiliatedKeywordValue::ListOfStrings(list_of_strings)
|
||||
if list_of_strings.is_empty() =>
|
||||
{
|
||||
list_of_strings.push(kw.value);
|
||||
}
|
||||
AffiliatedKeywordValue::ListOfStrings(list_of_strings) => {
|
||||
list_of_strings.clear();
|
||||
list_of_strings.push(kw.value);
|
||||
}
|
||||
_ => panic!("Invalid AffiliatedKeywordValue type."),
|
||||
}
|
||||
} else if is_list_of_objects_keyword(global_settings, translated_name.as_str()) {
|
||||
let initial_context = ContextElement::document_context();
|
||||
let initial_context = Context::new(global_settings, List::new(&initial_context));
|
||||
@@ -71,8 +87,25 @@ fn is_single_string_keyword<'g, 's>(
|
||||
_global_settings: &'g GlobalSettings<'g, 's>,
|
||||
name: &'s str,
|
||||
) -> bool {
|
||||
// TODO: Is this defined by an elisp variable? I'm only seeing this done for plot.
|
||||
name.eq_ignore_ascii_case("plot")
|
||||
// TODO: Is this defined by an elisp variable?
|
||||
for single_string_name in ["plot", "name"] {
|
||||
if name.eq_ignore_ascii_case(single_string_name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
fn is_list_of_single_string_keyword<'g, 's>(
|
||||
global_settings: &'g GlobalSettings<'g, 's>,
|
||||
name: &'s str,
|
||||
) -> bool {
|
||||
for single_string_name in ["results"] {
|
||||
if name.eq_ignore_ascii_case(single_string_name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
fn is_list_of_objects_keyword<'g, 's>(
|
||||
|
||||
Reference in New Issue
Block a user