summaryrefslogtreecommitdiff
path: root/dhall/src/core/value.rs
diff options
context:
space:
mode:
authorNadrieril2019-11-11 13:36:30 +0000
committerNadrieril2019-11-11 13:50:37 +0000
commitd28d114552e6c6cb913dce48893fa87e87bf11e2 (patch)
tree94965fc87a814de636705944b5a6f143855235b4 /dhall/src/core/value.rs
parent575adf9a7a87ba5d75548f7cd4efdec53c1fe17c (diff)
Propagate more spans
Diffstat (limited to '')
-rw-r--r--dhall/src/core/value.rs8
1 files changed, 6 insertions, 2 deletions
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<Const> {
match &*self.as_whnf() {