]> Cypherpunks repositories - gostls13.git/commitdiff
go/constants: rename go/exact to go/constants
authorAlan Donovan <adonovan@google.com>
Wed, 22 Apr 2015 15:25:29 +0000 (11:25 -0400)
committerAlan Donovan <adonovan@google.com>
Wed, 22 Apr 2015 16:59:31 +0000 (16:59 +0000)
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/9242
Reviewed-by: Rob Pike <r@golang.org>
20 files changed:
src/go/build/deps_test.go
src/go/constants/go13.go [moved from src/go/exact/go13.go with 96% similarity]
src/go/constants/go14.go [moved from src/go/exact/go14.go with 93% similarity]
src/go/constants/value.go [moved from src/go/exact/exact.go with 99% similarity]
src/go/constants/value_test.go [moved from src/go/exact/exact_test.go with 99% similarity]
src/go/internal/gcimporter/gcimporter.go
src/go/types.bash
src/go/types/api.go
src/go/types/builtins.go
src/go/types/check.go
src/go/types/conversions.go
src/go/types/decl.go
src/go/types/expr.go
src/go/types/object.go
src/go/types/operand.go
src/go/types/resolver.go
src/go/types/self_test.go
src/go/types/stmt.go
src/go/types/typexpr.go
src/go/types/universe.go

index 6d082418cf01b2382ac2017febdc2c0f6acc0899..3097a3289e16c32a4c66851695c14b536eb1a1ae 100644 (file)
@@ -340,11 +340,11 @@ var pkgDeps = map[string][]string{
        // dependencies.  Do not simply update them in situ.
        "container/heap":           {"sort"},
        "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/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/types":                 {"bytes", "container/heap", "fmt", "go/ast", "go/exact", "go/parser", "go/token", "io", "math", "path", "sort", "strconv", "strings", "sync", "unicode"},
+       "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/constants", "go/parser", "go/token", "io", "math", "path", "sort", "strconv", "strings", "sync", "unicode"},
        "image/internal/imageutil": {"image"},
        "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"},
similarity index 96%
rename from src/go/exact/go13.go
rename to src/go/constants/go13.go
index 1016c1415077f01ffecc09b71a7bc5db9eb41f4e..f445b82154d0bea656ac8450c5b481c9c093ad35 100644 (file)
@@ -4,7 +4,7 @@
 
 // +build !go1.4
 
-package exact
+package constants
 
 import (
        "math"
similarity index 93%
rename from src/go/exact/go14.go
rename to src/go/constants/go14.go
index b86e5d26097103efd2285d15f2cb5b9f1942608a..c698fa6de97edbda1c028620f9b41f273e7972b3 100644 (file)
@@ -4,7 +4,7 @@
 
 // +build go1.4
 
-package exact
+package constants
 
 import "math/big"
 
similarity index 99%
rename from src/go/exact/exact.go
rename to src/go/constants/value.go
index f0510ce669b238f1bf954cec4207bc8e8d0a8acc..ad4533c900d71535aa7068c70497e5aaf4bd624f 100644 (file)
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style
 // 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
-// and operations have unlimited precision.
+// and operations may have arbitrary or unlimited precision.
 //
 // A special Unknown value may be used when a value
 // is unknown due to an error. Operations on unknown
 // values produce unknown values unless specified
 // otherwise.
 //
-package exact // import "go/exact"
+package constants // import "go/constants"
 
 import (
        "fmt"
similarity index 99%
rename from src/go/exact/exact_test.go
rename to src/go/constants/value_test.go
index 0f170145e257bd1af84154d4b72d2aa6be12d58e..6a74e2d13cbc518f5ba174014a20b1878112052d 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package exact
+package constants
 
 import (
        "go/token"
index 523edb0bced5b60bf2a3875965ed8e3ae08f16e0..ee83a725fa1c15ee688f3d93a6c65cf6d83a7585 100644 (file)
@@ -18,7 +18,7 @@ import (
        "strings"
        "text/scanner"
 
-       "go/exact"
+       exact "go/constants"
        "go/types"
 )
 
index a3bfb7e640f1bd05b0b3461a928392f61650ac5d..1a384d410ab6d5557b6961e6bf10424a001388a1 100644 (file)
@@ -9,6 +9,10 @@
 # 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.
+#
+# 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
 
index 85160c483886240ab03f8fed0d1548ce5a1c56eb..a2a55e31e7de9d99d157826121086af829bb6210 100644 (file)
@@ -28,7 +28,7 @@ import (
        "bytes"
        "fmt"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 55dcb7a6e46e900d28e0d2ca47bfa41f0864e9f0..203a9c196ddcc47eb43cb22c797019c35e03cd8a 100644 (file)
@@ -8,7 +8,7 @@ package types
 
 import (
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 7a33c3cbcbe04d1a477010b17a9d02b97475218e..b4c356a6ed1f6af218a97c9078cbfaf473bf3950 100644 (file)
@@ -8,7 +8,7 @@ package types
 
 import (
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 256aabe9c7ed2ec72ba795dbcf21b847402064bd..0cf9953c4fd049736d477b769f6dc31a5022e324 100644 (file)
@@ -6,7 +6,7 @@
 
 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).
 // The result is in x.
index 968ec06ecb21abb7ba87f2686305b4f6efb3da9b..c2c18ecd069ded683f9e23004e4c8e7c9446dcc1 100644 (file)
@@ -6,7 +6,7 @@ package types
 
 import (
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 14674a95393f6437ab758368033850056d3bbaaf..f91d89e8b8f7e35d5af5449747423db81e097b46 100644 (file)
@@ -9,7 +9,7 @@ package types
 import (
        "fmt"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
        "math"
 )
index 79f30157bfbe9fd1e7f38a4583e625c5e05e880a..2404753b36873f1b44f95b7a464143b06f996a60 100644 (file)
@@ -8,7 +8,7 @@ import (
        "bytes"
        "fmt"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 2714c382a288a181e2a995e4d476fc12650452cb..88c387058e993a9ad2c84529ea21df2c50bfe4bf 100644 (file)
@@ -9,7 +9,7 @@ package types
 import (
        "bytes"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index fcf8c851b2e672177593cfdbf46334c951ccb92c..be46b59f11453aa552c2707c4b8c4c79ffa4b6a7 100644 (file)
@@ -7,7 +7,7 @@ package types
 import (
        "fmt"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
        pathLib "path"
        "strconv"
index d17eabbae536a54195265c395ba067fd099aff9d..85dc6ae0ecf1200f07babb523dbdf0fba61f1665 100644 (file)
@@ -31,7 +31,7 @@ func TestSelf(t *testing.T) {
        conf := Config{Importer: importer.Default()}
        _, err = conf.Check("go/types", fset, files, 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
                // for now so that the build remains green.
                // TODO(gri) fix this
index 53a99be5ad1e4411edddfd2c9fdbf98b8e8c0358..8b59df3eb6812fa15bc07ca50946ba19363e7912 100644 (file)
@@ -9,7 +9,7 @@ package types
 import (
        "fmt"
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
 )
 
index 36bf12b4e5ea36c8e310696c4372c101f3d499f9..afd1dabc06a5db29ff9ee2b97f8bdca2ee645427 100644 (file)
@@ -8,7 +8,7 @@ package types
 
 import (
        "go/ast"
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
        "sort"
        "strconv"
index 3c5a46d08a3305b2a32db0ebddb8c184f4979036..c02543e95174bbe9177e7ede149ed94ea3760b28 100644 (file)
@@ -7,7 +7,7 @@
 package types
 
 import (
-       "go/exact"
+       exact "go/constants" // Renamed to reduce diffs from x/tools.  TODO: remove
        "go/token"
        "strings"
 )