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/expr.rs | 15 ++++++++++++--- dhall_syntax/src/core/visitor.rs | 11 ++++++----- dhall_syntax/src/parser.rs | 14 +++++++------- dhall_syntax/src/printer.rs | 16 +++++++++++----- 4 files changed, 36 insertions(+), 20 deletions(-) (limited to 'dhall_syntax') diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs index 74eb993..4c809f8 100644 --- a/dhall_syntax/src/core/expr.rs +++ b/dhall_syntax/src/core/expr.rs @@ -12,6 +12,12 @@ pub type Double = NaiveDouble; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum Void {} +impl std::fmt::Display for Void { + fn fmt(&self, _f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { + match *self {} + } +} + pub fn trivial_result(x: Result) -> T { match x { Ok(x) => x, @@ -233,7 +239,9 @@ pub enum ExprF { Field(SubExpr, Label), /// `e.{ x, y, z }` Projection(SubExpr, DupTreeSet