From b68c3af578d1f6b0d1e32e7d88ef57774fb468d8 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 11 Nov 2019 11:20:32 +0000 Subject: Capture absence of span in Span itself --- dhall/src/phase/binary.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'dhall/src/phase/binary.rs') diff --git a/dhall/src/phase/binary.rs b/dhall/src/phase/binary.rs index 8c98f77..b4f18da 100644 --- a/dhall/src/phase/binary.rs +++ b/dhall/src/phase/binary.rs @@ -5,8 +5,9 @@ use std::vec; use dhall_syntax::map::DupTreeMap; use dhall_syntax::{ - rc, Expr, ExprF, FilePath, FilePrefix, Hash, Import, ImportLocation, - ImportMode, Integer, InterpolatedText, Label, Natural, Scheme, URL, V, + Expr, ExprF, FilePath, FilePrefix, Hash, Import, ImportLocation, + ImportMode, Integer, InterpolatedText, Label, Natural, RawExpr, Scheme, + Span, URL, V, }; use crate::error::{DecodeError, EncodeError}; @@ -24,6 +25,11 @@ pub(crate) fn encode(expr: &Expr) -> Result, EncodeError> { .map_err(|e| EncodeError::CBORError(e)) } +// Should probably rename this +pub fn rc(x: RawExpr) -> Expr { + Expr::new(x, Span::Decoded) +} + fn cbor_value_to_dhall(data: &cbor::Value) -> Result { use cbor::Value::*; use dhall_syntax::{BinOp, Builtin, Const}; -- cgit v1.2.3