diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-21 00:16:07 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-21 00:26:20 +0100 |
| commit | ee732468c7487c81aa6470571077988b75d36ebb (patch) | |
| tree | e0361bb75b8bbc3359b711f4009e165459d66248 /library/src/math | |
| parent | 15cd273c82a96128a63781981a4405fcd2b1e846 (diff) | |
Document text category
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 { |
