1
0
mirror of https://github.com/golang/go synced 2024-10-04 10:31:22 -06:00
Commit Graph

3 Commits

Author SHA1 Message Date
Robert Griesemer
e1d6b3c98d go/ast: fix ast.Walk
- change Walk signature to use an ast.Node instead of interface{}
- add Pos functions to a couple of ast types to make them proper nodes
- explicit nil checks where a node can be nil; incorrect ASTs cause Walk to crash

For now ast.Walk is exercised extensively as part of godoc's indexer;
so we have some confidence in its correctness. But this needs a test,
eventually.

Fixes #1326.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3481043
2010-12-09 10:22:01 -08:00
Robert Griesemer
e2da3b6498 gofmt: simplify "x, _ = range y" to "x = range y"
(inspired by CL 3529041 by hitchmanr@gmail.com)

R=rsc
CC=golang-dev
https://golang.org/cl/3527042
2010-12-09 10:11:57 -08:00
Robert Griesemer
f613015e0e go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible

R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00