1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00
The Go programming language
Go to file
Alan Donovan 897f6677ae refactor/lexical: understand the structure of the lexical environment.
The Uses, Defs and Scope information provided by go/types is
inadequate for answering "what if?" queries about the
structure of the lexical environment.

In this code, for example,

        var x int

        func f() {
                print(x)
                x := ""
                print(x)
        }

the two referring Idents x appear at the same lexical depth,
inside the function f's Scope object, yet they resolve to
different objects.

This package associates a lexical.Environment instance with
every reference to capture these differences.  Each
environment is a linked list of enclosing Blocks, and for each
block, a number indicating what prefix of its bindings are
visible.  (Zero for the first 'x' reference above, 1 for the
second.)

+ Smoke test over stdlib.

This functionality could be integrated with the type checker
in lieu of the not-so-useful types.Info.Scopes data, at little
extra cost in code or in running time/space.  We should talk
about that.

LGTM=sameer
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/143790043
2014-09-19 13:11:01 -04:00
astutil go.tools/astutil: delete all matching imports in DeleteImport 2014-08-14 11:51:51 -07:00
blog go.tools/blog: strip prefix when serving static content 2013-11-08 13:28:32 +11:00
cmd go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming. 2014-09-10 09:02:54 -04:00
container/intsets container/intsets: add benchmark of AppendTo method. 2014-06-19 14:35:37 -04:00
cover go.tools/cover: split parsing code out from cmd/cover 2013-12-03 20:55:21 -08:00
dashboard go.tools/dashboard/app: don't ignore field mismatch errors 2014-09-18 18:07:02 +10:00
go go.tools/go/types: documentation follow-up 2014-09-15 11:32:39 -07:00
godoc godoc/analysis: log one error per error package. 2014-09-16 16:24:52 -04:00
imports go.tools/imports: src/pkg -> src 2014-09-08 14:20:12 -04:00
oracle go.tools/*: replace $GOROOT/src/pkg with $GOROOT/src where appropriate. 2014-09-08 13:24:38 -04:00
playground go.tools/playground: return a better message for code starting with a shebang on non local mode 2014-08-01 15:04:49 -07:00
present go.tools/present: add support for figure captions 2014-07-15 08:23:16 -07:00
refactor refactor/lexical: understand the structure of the lexical environment. 2014-09-19 13:11:01 -04:00
.hgignore dashboard: add Cloud Storage upload support to create.go 2014-09-03 21:41:16 -07:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg codereview: switch defaultcc to golang-codereviews 2013-12-20 10:54:33 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools/README: minor correction. 2013-10-29 13:20:58 -04:00

This subrepository holds the source for various packages and tools that support
the Go programming language.

Some of the tools, godoc and vet for example, are included in binary Go distributions.
Others, including the Go oracle and the test coverage tool, can be fetched with "go get".

Packages include a type-checker for Go and an implementation of the
Static Single Assignment form (SSA) representation for Go programs.

To submit changes to this repository, see http://golang.org/doc/contribute.html.