Skip to content

Commit 222e8bc

Browse files
authored
Merge pull request #52 from philandstuff/std-pr-1052-with
Add `with` as proper term
2 parents bafc41e + 013c0b9 commit 222e8bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3396
-3301
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# Changelog
22

33
## [Unreleased]
4-
[Unreleased]: https://github.com/philandstuff/dhall-golang/compare/v4.1.0...HEAD
4+
[Unreleased]: https://github.com/philandstuff/dhall-golang/compare/v5.0.0...HEAD
5+
6+
## [5.0.0] - 2020-09-20
7+
[5.0.0]: https://github.com/philandstuff/dhall-golang/compare/v4.1.0...v5.1.0
8+
9+
This brings dhall-golang up to version 18.0.0 of the Dhall standard.
10+
11+
### Changed
12+
13+
* Language changes
14+
* Enable `with` optimizations
15+
16+
This implements the newly-possible `with` optimizations such that
17+
deeply-nested `with` expressions do not experience pathological
18+
slowdown.
519

620
## [4.1.0] - 2020-08-10
721
[4.1.0]: https://github.com/philandstuff/dhall-golang/compare/v4.0.0...v4.1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"fmt"
1919
"io/ioutil"
2020

21-
"github.com/philandstuff/dhall-golang/v4"
21+
"github.com/philandstuff/dhall-golang/v5"
2222
)
2323

2424
// Config can be a fairly arbitrary Go datatype. You would put your

binary/cbor.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"path"
99

1010
"github.com/fxamacker/cbor/v2"
11-
. "github.com/philandstuff/dhall-golang/v4/term"
11+
. "github.com/philandstuff/dhall-golang/v5/term"
1212
)
1313

1414
var nameToBuiltin = map[string]Term{
@@ -490,6 +490,20 @@ func decode(decodedCbor interface{}) (Term, error) {
490490
return nil, err
491491
}
492492
return EmptyList{Type: t}, nil
493+
case 29: // with
494+
r, err := decode(val[1])
495+
if err != nil {
496+
return nil, err
497+
}
498+
path, ok := val[2].([]string)
499+
if !ok {
500+
return nil, fmt.Errorf("couldn't interpret %v as []string", val[2])
501+
}
502+
v, err := decode(val[3])
503+
if err != nil {
504+
return nil, err
505+
}
506+
return With{r, path, v}, nil
493507
}
494508
}
495509
}

binary/performance_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"path"
88
"testing"
99

10-
"github.com/philandstuff/dhall-golang/v4/binary"
11-
"github.com/philandstuff/dhall-golang/v4/core"
12-
"github.com/philandstuff/dhall-golang/v4/imports"
13-
"github.com/philandstuff/dhall-golang/v4/internal"
14-
"github.com/philandstuff/dhall-golang/v4/term"
10+
"github.com/philandstuff/dhall-golang/v5/binary"
11+
"github.com/philandstuff/dhall-golang/v5/core"
12+
"github.com/philandstuff/dhall-golang/v5/imports"
13+
"github.com/philandstuff/dhall-golang/v5/internal"
14+
"github.com/philandstuff/dhall-golang/v5/term"
1515
)
1616

1717
func BenchmarkDecodeLargeExpression(b *testing.B) {

binary/semantic_hash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"crypto/sha256"
66

7-
"github.com/philandstuff/dhall-golang/v4/core"
7+
"github.com/philandstuff/dhall-golang/v5/core"
88
)
99

1010
// SemanticHash returns the semantic hash of an evaluated expression.

cmd/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"log"
77
"os"
88

9-
"github.com/philandstuff/dhall-golang/v4/binary"
10-
"github.com/philandstuff/dhall-golang/v4/core"
11-
"github.com/philandstuff/dhall-golang/v4/imports"
12-
"github.com/philandstuff/dhall-golang/v4/parser"
9+
"github.com/philandstuff/dhall-golang/v5/binary"
10+
"github.com/philandstuff/dhall-golang/v5/core"
11+
"github.com/philandstuff/dhall-golang/v5/imports"
12+
"github.com/philandstuff/dhall-golang/v5/parser"
1313
)
1414

1515
func main() {

core/ast.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"math"
66

7-
"github.com/philandstuff/dhall-golang/v4/term"
7+
"github.com/philandstuff/dhall-golang/v5/term"
88
)
99

1010
// A Value is a Dhall value in beta-normal form. You can think of

core/builtins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/philandstuff/dhall-golang/v4/term"
7+
"github.com/philandstuff/dhall-golang/v5/term"
88
)
99

1010
func (naturalBuild) Call(x Value) Value {

core/builtins_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package core_test
33
import (
44
. "github.com/onsi/ginkgo/extensions/table"
55
. "github.com/onsi/gomega"
6-
"github.com/philandstuff/dhall-golang/v4/core"
7-
"github.com/philandstuff/dhall-golang/v4/parser"
6+
"github.com/philandstuff/dhall-golang/v5/core"
7+
"github.com/philandstuff/dhall-golang/v5/parser"
88
)
99

1010
var _ = DescribeTable("ArgType of builtins", func(src, typ string) {

core/equivalence_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
. "github.com/onsi/ginkgo/extensions/table"
66
. "github.com/onsi/gomega"
77
"github.com/onsi/gomega/types"
8-
"github.com/philandstuff/dhall-golang/v4/term"
8+
"github.com/philandstuff/dhall-golang/v5/term"
99
)
1010

1111
// Ensure that alphaMatcher is a valid GomegaMatcher

0 commit comments

Comments
 (0)