From 80c8d87db595c91293af75d710464ac5379c7e28 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 10 Aug 2019 22:48:21 +0200 Subject: Update dhall-lang submodule --- dhall-lang | 2 +- dhall/build.rs | 13 +++++++++---- dhall/src/phase/binary.rs | 13 +++++++++++++ tests_buffer | 3 ++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dhall-lang b/dhall-lang index 9729d89..fb1c41d 160000 --- a/dhall-lang +++ b/dhall-lang @@ -1 +1 @@ -Subproject commit 9729d8939a6c79adf9a26dd20978fba6ec39bbec +Subproject commit fb1c41ddec1d35dadd89a70780698e1a73e179bd diff --git a/dhall/build.rs b/dhall/build.rs index bcb5d1c..8b23dd9 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -94,8 +94,12 @@ fn main() -> std::io::Result<()> { // Too slow in debug mode path == "success/largeExpression" // TODO: Inline headers - || path == "success/unit/import/parenthesizeUsing" || path == "success/unit/import/inlineUsing" + || path == "success/unit/import/Headers" + || path == "success/unit/import/HeadersDoubleHash" + || path == "success/unit/import/HeadersDoubleHashPrecedence" + || path == "success/unit/import/HeadersHashPrecedence" + || path == "success/unit/import/HeadersInteriorHash" // TODO: projection by expression || path == "success/recordProjectionByExpression" || path == "success/RecordProjectionByType" @@ -117,6 +121,7 @@ fn main() -> std::io::Result<()> { || path == "success/largeExpression" // TODO: Inline headers || path == "success/unit/import/inlineUsing" + || path == "success/unit/import/Headers" // TODO: projection by expression || path == "success/recordProjectionByExpression" || path == "success/RecordProjectionByType" @@ -140,13 +145,13 @@ fn main() -> std::io::Result<()> { path.starts_with("failure/") // Too slow in debug mode || path == "success/largeExpression" - // Too much of a pain to implement; shouldn't make a difference - // since lets disappear on normalization. - || path == "success/multilet" // See https://github.com/pyfisch/cbor/issues/109 || path == "success/double" + || path == "success/unit/DoubleLitExponentNoDot" + || path == "success/unit/DoubleLitSecretelyInt" // TODO: Inline headers || path == "success/unit/import/inlineUsing" + || path == "success/unit/import/Headers" // TODO: projection by expression || path == "success/recordProjectionByExpression" || path == "success/RecordProjectionByType" diff --git a/dhall/src/phase/binary.rs b/dhall/src/phase/binary.rs index 719b1c7..f4a9cc1 100644 --- a/dhall/src/phase/binary.rs +++ b/dhall/src/phase/binary.rs @@ -178,6 +178,19 @@ fn cbor_value_to_dhall( let l = Label::from(l.as_str()); Field(x, l) } + [U64(10), x, rest..] => { + let x = cbor_value_to_dhall(&x)?; + let labels = rest + .iter() + .map(|s| match s { + String(s) => Ok(Label::from(s.as_str())), + _ => Err(DecodeError::WrongFormatError( + "projection".to_owned(), + )), + }) + .collect::>()?; + Projection(x, labels) + } [U64(11), Object(map)] => { let map = cbor_map_to_dhall_opt_map(map)?; UnionType(map) diff --git a/tests_buffer b/tests_buffer index 4f8a375..c6366ba 100644 --- a/tests_buffer +++ b/tests_buffer @@ -7,6 +7,8 @@ success/ operators/ PrecedenceAll1 a ? b || c + d ++ e # f && g ∧ h ⫽ i ⩓ j * k == l != m n.o PrecedenceAll2 a b != c == d * e ⩓ f ⫽ g ∧ h && i # j ++ k + l || m ? n + LetNoAnnot let x = y in e + LetAnnot let x: T = y in e failure/ AssertNoAnnotation assert @@ -23,7 +25,6 @@ failure/ normalization: variables across import boundaries Text/show "" - Double/show -1.5e-10 TextLitNested1 "${""}${x}" TextLitNested2 "${"${x}"}" TextLitNested3 "${"${""}"}${x}" -- cgit v1.2.3