diff options
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/matrix.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index 92199774..49527354 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -22,6 +22,15 @@ impl VecNode { fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { Ok(Self(args.all()?).pack()) } + + fn field(&self, name: &str) -> Option<Value> { + match name { + "elements" => { + Some(Value::Array(self.0.iter().cloned().map(Value::Content).collect())) + } + _ => None, + } + } } impl Texify for VecNode { @@ -89,6 +98,15 @@ impl CasesNode { fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { Ok(Self(args.all()?).pack()) } + + fn field(&self, name: &str) -> Option<Value> { + match name { + "branches" => { + Some(Value::Array(self.0.iter().cloned().map(Value::Content).collect())) + } + _ => None, + } + } } impl Texify for CasesNode { |
