]> Cypherpunks repositories - gostls13.git/commitdiff
casify struct fields
authorRobert Griesemer <gri@golang.org>
Fri, 16 Jan 2009 23:31:34 +0000 (15:31 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 16 Jan 2009 23:31:34 +0000 (15:31 -0800)
R=r
OCL=22998
CL=22998

usr/gri/pretty/ast.go
usr/gri/pretty/compilation.go
usr/gri/pretty/parser.go
usr/gri/pretty/pretty.go

index 29d183391ed42371d76f08375ae941d46b474c41..84c404eb789ad74771ad79a1460d53c73d446f0f 100644 (file)
@@ -99,14 +99,14 @@ export func NewObject(pos, kind int, ident string) *Object {
 // Scopes
 
 export type Scope struct {
-       parent *Scope;
+       Parent *Scope;
        entries map[string] *Object;
 }
 
 
 export func NewScope(parent *Scope) *Scope {
        scope := new(Scope);
-       scope.parent = parent;
+       scope.Parent = parent;
        scope.entries = make(map[string]*Object, 8);
        return scope;
 }
@@ -127,7 +127,7 @@ func (scope *Scope) Lookup(ident string) *Object {
                if obj != nil {
                        return obj;
                }
-               scope = scope.parent;
+               scope = scope.Parent;
        }
        return nil;
 }
index ad802566f981a9f25d5ab58b5ea82e1385be8790..1d8f3cf1dd61cccd4e857f1b7ed1235c3c9fbd44 100644 (file)
@@ -24,13 +24,13 @@ func assert(b bool) {
 
 
 export type Flags struct {
-       verbose bool;
-       sixg bool;
-       deps bool;
-       columns bool;
-       testmode bool;
-       tokenchan bool;
-       naming bool;
+       Verbose bool;
+       Sixg bool;
+       Deps bool;
+       Columns bool;
+       Testmode bool;
+       Tokenchan bool;
+       Naming bool;
 }
 
 
@@ -125,18 +125,18 @@ export func Compile(src_file string, flags *Flags) (*AST.Program, int) {
        }
 
        var err errorHandler;
-       err.Init(src_file, src, flags.columns);
+       err.Init(src_file, src, flags.Columns);
 
        var scanner Scanner.Scanner;
-       scanner.Init(&err, src, true, flags.testmode);
+       scanner.Init(&err, src, true, flags.Testmode);
 
        var tstream <-chan *Scanner.Token;
-       if flags.tokenchan {
+       if flags.Tokenchan {
                tstream = scanner.TokenStream();
        }
 
        var parser Parser.Parser;
-       parser.Open(flags.verbose, flags.sixg, flags.deps, flags.naming, &scanner, tstream);
+       parser.Open(flags.Verbose, flags.Sixg, flags.Deps, flags.Naming, &scanner, tstream);
 
        prog := parser.ParseProgram();
 
index 1f975682e0c46175211e26adf260944f49d68ced..d72eeccd898efd0472454b4a0f66566266d30116 100644 (file)
@@ -160,7 +160,7 @@ func (P *Parser) OpenScope() {
 
 
 func (P *Parser) CloseScope() {
-       P.top_scope = P.top_scope.parent;
+       P.top_scope = P.top_scope.Parent;
 }
 
 
index 1d6ad575f0e04aa07dfacaebb39d84bda1ec175c..94233ee44d66e5959b1e46414e4c40fc8acd851f 100644 (file)
@@ -18,14 +18,14 @@ var (
 )
 
 func init() {
-       Flag.BoolVar(&flags.verbose, "v", false, "verbose mode: trace parsing");
-       Flag.BoolVar(&flags.sixg, "6g", true, "6g compatibility mode");
+       Flag.BoolVar(&flags.Verbose, "v", false, "verbose mode: trace parsing");
+       Flag.BoolVar(&flags.Sixg, "6g", true, "6g compatibility mode");
        //TODO fix this code again
-       //Flag.BoolVar(&flags.deps, "d", false, "print dependency information only");
-       Flag.BoolVar(&flags.columns, "columns", Platform.USER == "gri", "print column info in error messages");
-       Flag.BoolVar(&flags.testmode, "t", false, "test mode: interprets /* ERROR */ and /* SYNC */ comments");
-       Flag.BoolVar(&flags.tokenchan, "token_chan", false, "use token channel for scanner-parser connection");
-       Flag.BoolVar(&flags.naming, "naming", false, "verify export naming scheme");
+       //Flag.BoolVar(&flags.Deps, "d", false, "print dependency information only");
+       Flag.BoolVar(&flags.Columns, "columns", Platform.USER == "gri", "print column info in error messages");
+       Flag.BoolVar(&flags.Testmode, "t", false, "test mode: interprets /* ERROR */ and /* SYNC */ comments");
+       Flag.BoolVar(&flags.Tokenchan, "token_chan", false, "use token channel for scanner-parser connection");
+       Flag.BoolVar(&flags.Naming, "naming", false, "verify export naming scheme");
 }
 
 
@@ -55,7 +55,7 @@ func main() {
                        if nerrors > 0 {
                                return;
                        }
-                       if !flags.naming && !*silent && !flags.testmode {
+                       if !flags.Naming && !*silent && !flags.Testmode {
                                Printer.Print(prog);
                        }
                }