http://codereview.appspot.com/157082/diff/30/1003 File src/pkg/go/printer/nodes.go (right): http://codereview.appspot.com/157082/diff/30/1003#newcode668 src/pkg/go/printer/nodes.go:668: // TODO(gri): should treat[] like parentheses and undo one ...
15 years, 4 months ago
(2009-11-19 22:47:21 UTC)
#4
http://codereview.appspot.com/157082/diff/30/1003
File src/pkg/go/printer/nodes.go (right):
http://codereview.appspot.com/157082/diff/30/1003#newcode668
src/pkg/go/printer/nodes.go:668: // TODO(gri): should treat[] like parentheses
and undo one level of depth
I tried that on the index-heavy expressions
in the test list (all the index+shift+or expressions)
at one point but it didn't look right.
http://codereview.appspot.com/157082/diff/30/1003#newcode672
src/pkg/go/printer/nodes.go:672: if x.Colon.IsValid() {
(Assuming this is Colon.Pos.IsValid underneath)
I'm not sure about using x.Colon.IsValid() as the way to
tell whether this is a slice. Programs that generate AST
might not include position information, in which case
this test will fail. It will be a weird failure.
Maybe it makes sense to have a separate AST type for
slicing vs indexing? Or Colon bool instead of Colon Pos?
http://codereview.appspot.com/157082/diff/47/50 File src/pkg/go/ast/ast.go (right): http://codereview.appspot.com/157082/diff/47/50#newcode183 src/pkg/go/ast/ast.go:183: IndexExpr; Seems awkward to me: why not just put ...
15 years, 4 months ago
(2009-11-20 00:16:28 UTC)
#5
*** Submitted as http://code.google.com/p/go/source/detail?r=63f563584f4c *** Permit omission of hi bound in slices. R=r, rsc http://codereview.appspot.com/157082
15 years, 4 months ago
(2009-11-20 00:42:07 UTC)
#7
Issue 157082: code review 157082: Permit omission of hi bound in slices.
(Closed)
Created 15 years, 4 months ago by gri
Modified 15 years, 4 months ago
Reviewers: r, rsc
Base URL:
Comments: 4