summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/nze/value.rs
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-02-06 17:05:30 +0000
committerGitHub2020-02-06 17:05:30 +0000
commitce289aeb3db3085a327e3a509f69edcea0f86be0 (patch)
tree1f60a5f9007fc8a6df15873e55bf46ed2bd4ec26 /dhall/src/semantics/nze/value.rs
parenteb9129312edf574948df777acb340189dc147724 (diff)
parentc27d8ff15988b914d21135dadffe9871441c127f (diff)
Merge pull request #129 from Nadrieril/missing-features
Implement some missing features
Diffstat (limited to 'dhall/src/semantics/nze/value.rs')
-rw-r--r--dhall/src/semantics/nze/value.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/dhall/src/semantics/nze/value.rs b/dhall/src/semantics/nze/value.rs
index 1143781..607aa0d 100644
--- a/dhall/src/semantics/nze/value.rs
+++ b/dhall/src/semantics/nze/value.rs
@@ -167,6 +167,12 @@ impl Value {
typecheck(&type_of_builtin(b)).unwrap().eval_closed_expr(),
)
}
+ pub(crate) fn from_text(txt: impl ToString) -> Self {
+ Value::from_kind_and_type(
+ ValueKind::TextLit(TextLit::from_text(txt.to_string())),
+ Value::from_builtin(Builtin::Text),
+ )
+ }
pub(crate) fn as_const(&self) -> Option<Const> {
match &*self.kind() {