diff options
Diffstat (limited to 'src/description.rs')
| -rw-r--r-- | src/description.rs | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/src/description.rs b/src/description.rs index 92af9c1..4f3b08a 100644 --- a/src/description.rs +++ b/src/description.rs @@ -1,4 +1,5 @@  //! Reference entry description. +use crate::gloss_list::{Error as GlossListError, GlossList};  use crate::itemized_list::{Error as ItemizedListError, ItemizedList};  use crate::table::{Error as TableError, Informal, Table};  use crate::variable_list::{Error as VariableListError, VariableList}; @@ -111,6 +112,11 @@ impl FromElements for Description                          .map(Part::Table)                          .map_err(Self::Error::InvalidTable),                  ), +                "glosslist" => Some( +                    GlossList::from_elements(part_elem.child_elements()) +                        .map(Part::GlossList) +                        .map_err(Self::Error::InvalidGlossList), +                ),                  "title" => None,                  name => Some(Err(Self::Error::UnknownPartFound(name.to_string()))),              }) @@ -150,6 +156,10 @@ pub enum Error      /// Invalid table.      #[error("Invalid table")]      InvalidTable(#[source] TableError), + +    /// Invalid gloss list. +    #[error("Invalid gloss list")] +    InvalidGlossList(#[source] GlossListError),  }  /// Description part. @@ -173,6 +183,9 @@ pub enum Part      /// Table.      Table(Table), + +    /// Gloss list. +    GlossList(GlossList),  }  /// Reference entry description paragraph.  | 
