From 8d45d633dfa60e8d64c9e6e742de4e33496bf0fa Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 13 Aug 2019 22:11:45 +0200 Subject: Store Imports in their own node instead of in Embed --- dhall_syntax/src/core/visitor.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dhall_syntax/src/core/visitor.rs') diff --git a/dhall_syntax/src/core/visitor.rs b/dhall_syntax/src/core/visitor.rs index f2f3b32..f3d9194 100644 --- a/dhall_syntax/src/core/visitor.rs +++ b/dhall_syntax/src/core/visitor.rs @@ -153,6 +153,7 @@ where Field(e, l) => Field(v.visit_subexpr(e)?, l.clone()), Projection(e, ls) => Projection(v.visit_subexpr(e)?, ls.clone()), Assert(e) => Assert(v.visit_subexpr(e)?), + Import(a) => Import(a.clone()), Embed(a) => Embed(v.visit_embed(a)?), }) } @@ -246,8 +247,8 @@ where pub struct ResolveVisitor(pub F1); -impl<'a, 'b, E2, Err, F1> - ExprFFallibleVisitor<'a, SubExpr, SubExpr, Import, E2> +impl<'a, 'b, E, E2, Err, F1> + ExprFFallibleVisitor<'a, SubExpr, SubExpr, E, E2> for &'b mut ResolveVisitor where F1: FnMut(&Import) -> Result, @@ -256,7 +257,7 @@ where fn visit_subexpr( &mut self, - subexpr: &'a SubExpr, + subexpr: &'a SubExpr, ) -> Result, Self::Error> { Ok(subexpr.rewrap( subexpr @@ -264,7 +265,7 @@ where .traverse_resolve_with_visitor(&mut **self)?, )) } - fn visit_embed(self, embed: &'a Import) -> Result { - (self.0)(embed) + fn visit_embed(self, _embed: &'a E) -> Result { + unimplemented!() } } -- cgit v1.2.3