Commit 67783935 authored by Alan Donovan's avatar Alan Donovan

go/constants: rename go/exact to go/constants

since the "precision" parameter means constant arithmetic is not
necessarily exact.

As requested by gri, within go/types, the local import name 'exact'
has been kept, to reduce the diff with the x/tools branch.  This may
be changed later.

Since the go/types.bash script was already obsolete, I added a comment
to this effect.

Tested with all.bash.

Change-Id: I45153688d9d8afa8384fb15229b0124c686059b4
Reviewed-on: https://go-review.googlesource.com/9242Reviewed-by: 's avatarRob Pike <r@golang.org>
parent ca9128f1
...@@ -340,11 +340,11 @@ var pkgDeps = map[string][]string{ ...@@ -340,11 +340,11 @@ var pkgDeps = map[string][]string{
// dependencies. Do not simply update them in situ. // dependencies. Do not simply update them in situ.
"container/heap": {"sort"}, "container/heap": {"sort"},
"debug/plan9obj": {"encoding/binary", "errors", "fmt", "io", "os"}, "debug/plan9obj": {"encoding/binary", "errors", "fmt", "io", "os"},
"go/exact": {"fmt", "go/token", "math/big", "strconv"}, "go/constants": {"fmt", "go/token", "math/big", "strconv"},
"go/format": {"bytes", "fmt", "go/ast", "go/parser", "go/printer", "go/token", "internal/format", "io"}, "go/format": {"bytes", "fmt", "go/ast", "go/parser", "go/printer", "go/token", "internal/format", "io"},
"go/importer": {"go/internal/gcimporter", "go/types", "io", "runtime"}, "go/importer": {"go/internal/gcimporter", "go/types", "io", "runtime"},
"go/internal/gcimporter": {"bufio", "errors", "fmt", "go/build", "go/exact", "go/token", "go/types", "io", "os", "path/filepath", "strconv", "strings", "text/scanner"}, "go/internal/gcimporter": {"bufio", "errors", "fmt", "go/build", "go/constants", "go/token", "go/types", "io", "os", "path/filepath", "strconv", "strings", "text/scanner"},
"go/types": {"bytes", "container/heap", "fmt", "go/ast", "go/exact", "go/parser", "go/token", "io", "math", "path", "sort", "strconv", "strings", "sync", "unicode"}, "go/types": {"bytes", "container/heap", "fmt", "go/ast", "go/constants", "go/parser", "go/token", "io", "math", "path", "sort", "strconv", "strings", "sync", "unicode"},
"image/internal/imageutil": {"image"}, "image/internal/imageutil": {"image"},
"internal/format": {"bytes", "go/ast", "go/parser", "go/printer", "go/token", "strings"}, "internal/format": {"bytes", "go/ast", "go/parser", "go/printer", "go/token", "strings"},
"internal/mime": {"bytes", "encoding/base64", "errors", "fmt", "io", "io/ioutil", "strconv", "strings", "unicode"}, "internal/mime": {"bytes", "encoding/base64", "errors", "fmt", "io", "io/ioutil", "strconv", "strings", "unicode"},
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// +build !go1.4 // +build !go1.4
package exact package constants
import ( import (
"math" "math"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// +build go1.4 // +build go1.4
package exact package constants
import "math/big" import "math/big"
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package exact implements Values representing untyped // Package constants implements Values representing untyped
// Go constants and the corresponding operations. Values // Go constants and the corresponding operations. Values
// and operations have unlimited precision. // and operations may have arbitrary or unlimited precision.
// //
// A special Unknown value may be used when a value // A special Unknown value may be used when a value
// is unknown due to an error. Operations on unknown // is unknown due to an error. Operations on unknown
// values produce unknown values unless specified // values produce unknown values unless specified
// otherwise. // otherwise.
// //
package exact // import "go/exact" package constants // import "go/constants"
import ( import (
"fmt" "fmt"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package exact package constants
import ( import (
"go/token" "go/token"
......
...@@ -18,7 +18,7 @@ import ( ...@@ -18,7 +18,7 @@ import (
"strings" "strings"
"text/scanner" "text/scanner"
"go/exact" exact "go/constants"
"go/types" "go/types"
) )
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
# original sources in x/tools. Imports are renamed as needed. # original sources in x/tools. Imports are renamed as needed.
# #
# Delete this script once go/exact and go/types don't exist anymore in x/tools. # Delete this script once go/exact and go/types don't exist anymore in x/tools.
#
# NOTE(adonovan): the standard packages have intentionally diverged
# from x/tools, so this script is a unlikely to be useful. Upstream
# changes should be cherry-picked in to the standard library.
set -e set -e
......
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -8,7 +8,7 @@ package types ...@@ -8,7 +8,7 @@ package types
import ( import (
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -8,7 +8,7 @@ package types ...@@ -8,7 +8,7 @@ package types
import ( import (
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
package types package types
import "go/exact" import exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
// Conversion type-checks the conversion T(x). // Conversion type-checks the conversion T(x).
// The result is in x. // The result is in x.
......
...@@ -6,7 +6,7 @@ package types ...@@ -6,7 +6,7 @@ package types
import ( import (
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -9,7 +9,7 @@ package types ...@@ -9,7 +9,7 @@ package types
import ( import (
"fmt" "fmt"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
"math" "math"
) )
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -9,7 +9,7 @@ package types ...@@ -9,7 +9,7 @@ package types
import ( import (
"bytes" "bytes"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -7,7 +7,7 @@ package types ...@@ -7,7 +7,7 @@ package types
import ( import (
"fmt" "fmt"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
pathLib "path" pathLib "path"
"strconv" "strconv"
......
...@@ -31,7 +31,7 @@ func TestSelf(t *testing.T) { ...@@ -31,7 +31,7 @@ func TestSelf(t *testing.T) {
conf := Config{Importer: importer.Default()} conf := Config{Importer: importer.Default()}
_, err = conf.Check("go/types", fset, files, nil) _, err = conf.Check("go/types", fset, files, nil)
if err != nil { if err != nil {
// Importing go.tools/go/exact doensn't work in the // Importing go/constants doesn't work in the
// build dashboard environment. Don't report an error // build dashboard environment. Don't report an error
// for now so that the build remains green. // for now so that the build remains green.
// TODO(gri) fix this // TODO(gri) fix this
......
...@@ -9,7 +9,7 @@ package types ...@@ -9,7 +9,7 @@ package types
import ( import (
"fmt" "fmt"
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
) )
......
...@@ -8,7 +8,7 @@ package types ...@@ -8,7 +8,7 @@ package types
import ( import (
"go/ast" "go/ast"
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
"sort" "sort"
"strconv" "strconv"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
package types package types
import ( import (
"go/exact" exact "go/constants" // Renamed to reduce diffs from x/tools. TODO: remove
"go/token" "go/token"
"strings" "strings"
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment