]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: factor out position comparison, share more code
authorRobert Griesemer <gri@golang.org>
Wed, 11 Jan 2023 17:17:55 +0000 (09:17 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 17 Jan 2023 19:55:42 +0000 (19:55 +0000)
commit248950f1928c543c31ac2d331213ce949e1b9886
treee7bab676bc52f61497274c281ed82cbfa07ef404
parent925182263164f44ec02bc90498da4b8dab4c9810
go/types, types2: factor out position comparison, share more code

This CL introduces the new files util.go and util_test.go for both
type checkers; these files factor out functionality that is different
between the type checkers so that more code (that is otherwise mostly
the same) can be generated.

With cmpPos/CmpPos factored out, go/types/scope.go can now be generated.

Change-Id: I35f67e53d83b3c5086a559b1e826db83d38ee217
Reviewed-on: https://go-review.googlesource.com/c/go/+/461596
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
15 files changed:
src/cmd/compile/internal/types2/api_test.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/mono.go
src/cmd/compile/internal/types2/scope.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/util.go [new file with mode: 0644]
src/cmd/compile/internal/types2/util_test.go [new file with mode: 0644]
src/go/types/api_test.go
src/go/types/decl.go
src/go/types/generator.go
src/go/types/mono.go
src/go/types/scope.go
src/go/types/stmt.go
src/go/types/util.go [new file with mode: 0644]
src/go/types/util_test.go [new file with mode: 0644]