Skip to content

Commit

Permalink
feat: impl from multiscripts for tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nfejzic committed Nov 24, 2023
1 parent cb3ac83 commit fa9d153
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/elements/mmultiscripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ impl Multiscripts {
}
}

crate::tag_from_type!(Multiscripts => Multiscripts);

#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct MultiscriptsBuilder<T> {
content: Option<MathMl>,
Expand Down Expand Up @@ -59,6 +61,15 @@ impl<T> MultiscriptsBuilder<T> {
}
}

impl MultiscriptsBuilder<Init> {
pub fn build(self) -> Multiscripts {
Multiscripts {
content: self.content.expect("Guaranteed to be init"),
attributes: self.attr,
}
}
}

/// Presubscripts and tensor notations are represented by the `mmultiscripts` element. The
/// `mprescripts` element is used as a separator between the `postscripts` and `prescripts`.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod markers;

use elements::{
grouping::{Action, Error},
scripted::Multiscripts,
Annotation, Frac, Ident, Matrix, Num, Operator, Padded, Semantics, Space, Table, Text,
};

Expand All @@ -16,6 +17,7 @@ pub(crate) enum Tag {
Error(Error),
Frac(Frac),
Ident(Ident),
Multiscripts(Multiscripts),
Num(Num),
Operator(Operator),
Padded(Padded),
Expand Down

0 comments on commit fa9d153

Please sign in to comment.