diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
| commit | 264a7dedd42e27cd9e604037640cf0594b2ec46b (patch) | |
| tree | d26feea399d54bb86bd44878f40293983bf5251d /src/eval/ops.rs | |
| parent | ca3df70e2a5069832d7d2135967674c34a155442 (diff) | |
Scheduled maintenance 🔨
- New naming scheme
- TextNode instead of NodeText
- CallExpr instead of ExprCall
- ...
- Less glob imports
- Removes Value::Args variant
- Removes prelude
- Renames Layouted to Fragment
- Moves font into env
- Moves shaping into layout
- Moves frame into separate module
Diffstat (limited to 'src/eval/ops.rs')
| -rw-r--r-- | src/eval/ops.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs index c4adf587..bef4dd58 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -1,4 +1,5 @@ -use super::*; +use super::{ArrayValue, DictValue, TemplateNode, Value}; +use crate::syntax::Span; use Value::*; /// Apply the plus operator to a value. @@ -189,12 +190,12 @@ fn value_eq(lhs: &Value, rhs: &Value) -> bool { } /// Compute whether two arrays are equal. -fn array_eq(a: &ValueArray, b: &ValueArray) -> bool { +fn array_eq(a: &ArrayValue, b: &ArrayValue) -> bool { a.len() == b.len() && a.iter().zip(b).all(|(x, y)| value_eq(x, y)) } /// Compute whether two dictionaries are equal. -fn dict_eq(a: &ValueDict, b: &ValueDict) -> bool { +fn dict_eq(a: &DictValue, b: &DictValue) -> bool { a.len() == b.len() && a.iter().all(|(k, x)| b.get(k).map_or(false, |y| value_eq(x, y))) } |
