summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2019-03-21 21:27:36 +0100
committerNadrieril2019-03-21 21:27:36 +0100
commit8d527e88168885ab754a039219d0ae682fa4508b (patch)
treeb26d26902ba84d611f9905add97b3a29d0dcf025 /dhall
parent6cbe21b84ffd274f92791ab8dbf9af6527978688 (diff)
Follow the spec for handling Doubles
Diffstat (limited to 'dhall')
-rw-r--r--dhall/src/binary.rs2
-rw-r--r--dhall/tests/parser.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs
index e8fcdab..8c5b902 100644
--- a/dhall/src/binary.rs
+++ b/dhall/src/binary.rs
@@ -34,7 +34,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
},
},
U64(n) => Var(V(Label::from("_"), *n as usize)),
- F64(x) => DoubleLit(*x),
+ F64(x) => DoubleLit((*x).into()),
Bool(b) => BoolLit(*b),
Array(vec) => match vec.as_slice() {
[String(l), U64(n)] => {
diff --git a/dhall/tests/parser.rs b/dhall/tests/parser.rs
index 678c198..4fa0ff7 100644
--- a/dhall/tests/parser.rs
+++ b/dhall/tests/parser.rs
@@ -18,7 +18,7 @@ parser_success!(spec_parser_success_annotations, "annotations");
parser_success!(spec_parser_success_blockComment, "blockComment");
parser_success!(spec_parser_success_builtins, "builtins");
// parser_success!(spec_parser_success_collectionImportType, "collectionImportType");
-// parser_success!(spec_parser_success_double, "double");
+parser_success!(spec_parser_success_double, "double");
parser_success!(spec_parser_success_doubleQuotedString, "doubleQuotedString");
// parser_success!(spec_parser_success_environmentVariables, "environmentVariables");
// parser_success!(spec_parser_success_escapedDoubleQuotedString, "escapedDoubleQuotedString");