Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3547)

Delta Between Two Patch Sets: src/pkg/go/printer/nodes.go

Issue 189080: code review 189080: Steps towards tracking scopes for identifiers. (Closed)
Left Patch Set: code review 189080: Steps towards tracking scopes for identifiers. Created 15 years, 2 months ago
Right Patch Set: code review 189080: Steps towards tracking scopes for identifiers. Created 15 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/go/parser/parser.go ('k') | src/pkg/go/printer/printer.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // This file implements printing of AST nodes; specifically 5 // This file implements printing of AST nodes; specifically
6 // expressions, statements, declarations, and files. It uses 6 // expressions, statements, declarations, and files. It uses
7 // the print functionality implemented in printer.go. 7 // the print functionality implemented in printer.go.
8 8
9 package printer 9 package printer
10 10
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 return 302 return
303 } 303 }
304 304
305 305
306 func identListSize(list []*ast.Ident, maxSize int) (size int) { 306 func identListSize(list []*ast.Ident, maxSize int) (size int) {
307 for i, x := range list { 307 for i, x := range list {
308 if i > 0 { 308 if i > 0 {
309 size += 2 // ", " 309 size += 2 // ", "
310 } 310 }
311 » » size += len(x.Value()) 311 » » size += len(x.Name())
312 if size >= maxSize { 312 if size >= maxSize {
313 break 313 break
314 } 314 }
315 } 315 }
316 return 316 return
317 } 317 }
318 318
319 319
320 func (p *printer) isOneLineFieldList(list []*ast.Field) bool { 320 func (p *printer) isOneLineFieldList(list []*ast.Field) bool {
321 if len(list) != 1 { 321 if len(list) != 1 {
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 if prev != tok { 1355 if prev != tok {
1356 min = 2 1356 min = 2
1357 } 1357 }
1358 p.linebreak(d.Pos().Line, min, maxDeclNewlines, ignore, false) 1358 p.linebreak(d.Pos().Line, min, maxDeclNewlines, ignore, false)
1359 p.decl(d, atTop, ignoreMultiLine) 1359 p.decl(d, atTop, ignoreMultiLine)
1360 } 1360 }
1361 } 1361 }
1362 1362
1363 p.print(newline) 1363 p.print(newline)
1364 } 1364 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b