summaryrefslogtreecommitdiff
path: root/src/pkg/go/ast/scope.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:35:38 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:35:38 -0800
commite4bd81f903362d998f7bfc02095935408aff0bc5 (patch)
tree05f75a90e239d33be427da4f9c5596d2fcb3dc96 /src/pkg/go/ast/scope.go
parentd9527dd16f72598b54a64550607bf892efa12384 (diff)
downloadgolang-e4bd81f903362d998f7bfc02095935408aff0bc5.tar.gz
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 3rd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180048
Diffstat (limited to 'src/pkg/go/ast/scope.go')
-rw-r--r--src/pkg/go/ast/scope.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/go/ast/scope.go b/src/pkg/go/ast/scope.go
index 240953673..e8ad12f97 100644
--- a/src/pkg/go/ast/scope.go
+++ b/src/pkg/go/ast/scope.go
@@ -11,13 +11,13 @@ package ast
// NOTE: WORK IN PROGRESS
//
type Scope struct {
- Outer *Scope;
- Names map[string]*Ident;
+ Outer *Scope
+ Names map[string]*Ident
}
// NewScope creates a new scope nested in the outer scope.
-func NewScope(outer *Scope) *Scope { return &Scope{outer, make(map[string]*Ident)} }
+func NewScope(outer *Scope) *Scope { return &Scope{outer, make(map[string]*Ident)} }
// Declare inserts an identifier into the scope s. If the
@@ -28,8 +28,8 @@ func (s *Scope) Declare(ident *Ident) bool {
if _, found := s.Names[ident.Value]; found {
return false
}
- s.Names[ident.Value] = ident;
- return true;
+ s.Names[ident.Value] = ident
+ return true
}
@@ -43,7 +43,7 @@ func (s *Scope) Lookup(name string) *Ident {
return ident
}
}
- return nil;
+ return nil
}