diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-04 15:01:38 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-04 15:01:38 +0100 |
commit | c49f62a8c369e58ee5cbffe853a436e724789d2f (patch) | |
tree | a219e8377a3cac00990cebaa9b19507a48b64b2e /src/description.rs | |
parent | dcf34eff5651294d7c579431143b8638fbe338df (diff) |
feat: add gloss list support
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. |