xso-proc: add support for child elements

This commit is contained in:
Jonas Schäfer 2024-06-29 15:22:52 +02:00
commit 5bd36eccfc
11 changed files with 576 additions and 13 deletions

View file

@ -79,3 +79,11 @@ pub(super) fn on_missing_attribute(parent_name: &ParentRef, field: &Member) -> S
parent_name
)
}
/// Create a string error message for a missing child element.
///
/// `parent_name` should point at the compound which is being parsed and
/// `field` should be the field to which the child belongs.
pub(super) fn on_missing_child(parent_name: &ParentRef, field: &Member) -> String {
format!("Missing child {} in {}.", FieldName(&field), parent_name)
}