diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-01-19 21:50:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-01-19 21:53:24 +0100 |
| commit | 95e6b078fecddeaa3d6f2c920b617201b74bf01e (patch) | |
| tree | 1c03b0b16d614a5a2350dccf71a1eb1e34f9a812 /tests/src/spanless.rs | |
| parent | 277f2d2176f5e98305870f90b16af3feae1bb3d1 (diff) | |
Move to non-fatal errors 🪂 [WIP]
- Dynamic models instead of SyntaxTrees
- No more ParseResult/LayoutResult
- Errors and Decorations which are propagated to parent contexts
- Models are finally clonable
Diffstat (limited to 'tests/src/spanless.rs')
| -rw-r--r-- | tests/src/spanless.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/src/spanless.rs b/tests/src/spanless.rs index fde5a2ed..87d3f39d 100644 --- a/tests/src/spanless.rs +++ b/tests/src/spanless.rs @@ -13,15 +13,17 @@ impl SpanlessEq<Vec<Spanned<Token<'_>>>> for Vec<Spanned<Token<'_>>> { } } -impl SpanlessEq<SyntaxTree> for SyntaxTree { - fn spanless_eq(&self, other: &SyntaxTree) -> bool { - fn downcast(func: &FuncCall) -> &DebugFn { - func.0.downcast::<DebugFn>().expect("not a debug fn") +impl SpanlessEq<SyntaxModel> for SyntaxModel { + fn spanless_eq(&self, other: &SyntaxModel) -> bool { + fn downcast(func: &dyn Model) -> &DebugFn { + func.downcast::<DebugFn>().expect("not a debug fn") } self.nodes.len() == other.nodes.len() && self.nodes.iter().zip(&other.nodes).all(|(x, y)| match (&x.v, &y.v) { - (Node::Func(a), Node::Func(b)) => downcast(a).spanless_eq(downcast(b)), + (Node::Model(a), Node::Model(b)) => { + downcast(a.as_ref()).spanless_eq(downcast(b.as_ref())) + } (a, b) => a == b, }) } |
