From 7e523ae1903ae2d8bca8b3a8352167d7bac5b2b5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 14 Sep 2020 23:09:22 +0100 Subject: spec: Enable `with` optimizations --- dhall/src/operations/kind.rs | 3 ++ dhall/src/operations/normalization.rs | 2 +- dhall/src/operations/typecheck.rs | 2 +- dhall/src/semantics/resolve/resolve.rs | 32 ++++++++++++++++++++-- dhall/src/syntax/ast/span.rs | 1 - dhall/src/syntax/binary/decode.rs | 21 ++++++++++++++ dhall/src/syntax/binary/encode.rs | 4 +++ dhall/src/syntax/text/parser.rs | 26 ++++-------------- dhall/src/syntax/text/printer.rs | 4 +++ dhall/tests/parser/success/unit/WithB.txt | 2 +- dhall/tests/parser/success/unit/WithMultipleB.txt | 2 +- .../tests/parser/success/unit/WithPrecedence1B.txt | 2 +- .../tests/parser/success/unit/WithPrecedence2B.txt | 2 +- .../tests/parser/success/unit/WithPrecedence3B.txt | 2 +- .../failure/unit/WithInvalidOverrideA.txt | 6 ++++ 15 files changed, 80 insertions(+), 31 deletions(-) (limited to 'dhall') diff --git a/dhall/src/operations/kind.rs b/dhall/src/operations/kind.rs index 0ee9671..2b035ef 100644 --- a/dhall/src/operations/kind.rs +++ b/dhall/src/operations/kind.rs @@ -55,6 +55,8 @@ pub enum OpKind { ProjectionByExpr(SubExpr, SubExpr), /// `x::y` Completion(SubExpr, SubExpr), + /// `x with a.b.c = y` + With(SubExpr, Vec