From d28d114552e6c6cb913dce48893fa87e87bf11e2 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 11 Nov 2019 13:36:30 +0000 Subject: Propagate more spans --- dhall/src/core/value.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dhall/src/core') diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index b6c156e..61c7015 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -136,7 +136,7 @@ impl Value { .into_value() } pub(crate) fn from_valuef_and_type(v: ValueF, t: Value) -> Value { - Value::new(v, Unevaled, t, Span::PlaceHolder) + Value::new(v, Unevaled, t, Span::Artificial) } pub(crate) fn from_valuef_and_type_and_span( v: ValueF, @@ -146,7 +146,7 @@ impl Value { Value::new(v, Unevaled, t, span) } pub(crate) fn from_valuef_and_type_whnf(v: ValueF, t: Value) -> Value { - Value::new(v, WHNF, t, Span::PlaceHolder) + Value::new(v, WHNF, t, Span::Artificial) } pub(crate) fn from_const(c: Const) -> Self { const_to_value(c) @@ -154,6 +154,10 @@ impl Value { pub(crate) fn from_builtin(b: Builtin) -> Self { builtin_to_value(b) } + pub(crate) fn with_span(self, span: Span) -> Self { + self.as_internal_mut().span = span; + self + } pub(crate) fn as_const(&self) -> Option { match &*self.as_whnf() { -- cgit v1.2.3