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

Side by Side Diff: src/cmd/cgo/ast.go

Issue 194098: code review 194098: More steps towards tracking of identifier scopes. (Closed)
Patch Set: code review 194098: More steps towards tracking of identifier scopes. 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:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/cmd/cgo/gcc.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Parse input AST and prepare Prog structure. 5 // Parse input AST and prepare Prog structure.
6 6
7 package main 7 package main
8 8
9 import ( 9 import (
10 "fmt" 10 "fmt"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // A FuncType collects information about a function type in both the C and Go wo rlds. 54 // A FuncType collects information about a function type in both the C and Go wo rlds.
55 type FuncType struct { 55 type FuncType struct {
56 Params []*Type 56 Params []*Type
57 Result *Type 57 Result *Type
58 Go *ast.FuncType 58 Go *ast.FuncType
59 } 59 }
60 60
61 func openProg(name string, p *Prog) { 61 func openProg(name string, p *Prog) {
62 var err os.Error 62 var err os.Error
63 » p.AST, err = parser.ParseFile(name, nil, parser.ParseComments) 63 » p.AST, err = parser.ParseFile(name, nil, nil, parser.ParseComments)
64 if err != nil { 64 if err != nil {
65 if list, ok := err.(scanner.ErrorList); ok { 65 if list, ok := err.(scanner.ErrorList); ok {
66 // If err is a scanner.ErrorList, its String will print just 66 // If err is a scanner.ErrorList, its String will print just
67 // the first error and then (+n more errors). 67 // the first error and then (+n more errors).
68 // Instead, turn it into a new Error that will return 68 // Instead, turn it into a new Error that will return
69 // details for all the errors. 69 // details for all the errors.
70 for _, e := range list { 70 for _, e := range list {
71 fmt.Fprintln(os.Stderr, e) 71 fmt.Fprintln(os.Stderr, e)
72 } 72 }
73 os.Exit(2) 73 os.Exit(2)
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 case []ast.Stmt: 321 case []ast.Stmt:
322 for _, s := range n { 322 for _, s := range n {
323 walk(s, p, context) 323 walk(s, p, context)
324 } 324 }
325 case []ast.Spec: 325 case []ast.Spec:
326 for _, s := range n { 326 for _, s := range n {
327 walk(s, p, context) 327 walk(s, p, context)
328 } 328 }
329 } 329 }
330 } 330 }
OLDNEW
« no previous file with comments | « no previous file | src/cmd/cgo/gcc.go » ('j') | no next file with comments »

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