while cursor.check_or(false, is_annotation_open)? { let annotation = handler(parse_kv_annotation(cursor)?);
match annotation { // Check if the key is the registered key "u-ca".
Some(kv) if T::check_calendar_key(kv.key) => { // Check the calendar match calendar {
Some(calendar) // if calendars do not match and one of them is critical if calendar.value != kv.value && (calendar.critical || kv.critical) =>
{ return Err(ParseError::CriticalDuplicateCalendar)
} // If there is not yet a calendar, save it.
None => {
calendar = Some(kv);
}
_ => {}
}
}
Some(unknown_kv) => { // Throw an error on any unrecognized annotations that are marked as critical. if unknown_kv.critical { return Err(ParseError::UnrecognizedCritical);
}
}
None => {}
}
}
Ok(calendar.map(|a| a.value))
}
/// Parse an annotation with an `AnnotationKey`=`AnnotationValue` pair. fn parse_kv_annotation<'a, T: EncodingType>(
cursor: &mut Cursor<'a, T>,
) -> ParserResult<Annotation<'a, T>> {
assert_syntax!(
is_annotation_open(cursor.next_or(ParseError::AnnotationOpen)?),
AnnotationOpen
);
let critical = cursor.check_or(false, is_critical_flag)?;
cursor.advance_if(critical);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.