]> Cypherpunks repositories - gostls13.git/commitdiff
s/switch _ :=/switch/
authorAustin Clements <aclements@csail.mit.edu>
Fri, 25 Sep 2009 16:37:35 +0000 (09:37 -0700)
committerAustin Clements <aclements@csail.mit.edu>
Fri, 25 Sep 2009 16:37:35 +0000 (09:37 -0700)
R=rsc
APPROVED=rsc
DELTA=36  (0 added, 0 deleted, 36 changed)
OCL=34971
CL=35006

usr/austin/eval/expr.go
usr/austin/eval/expr1.go
usr/austin/eval/gen.go
usr/austin/eval/typec.go
usr/austin/eval/world.go

index 5c4e7924917c150e9ec0a0da79b1f24b18588a19..e8ca9331469bff410817023e8bcce37de4b679f2 100644 (file)
@@ -153,7 +153,7 @@ func (a *expr) convertTo(t Type) *expr {
 // exceeds max.  If negErr is not "", produces an error if possible if
 // the value is negative.
 func (a *expr) convertToInt(max int64, negErr string, errOp string) *expr {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *idealIntType:
                val := a.asIdealInt()();
                if negErr != "" && val.IsNeg() {
@@ -1773,7 +1773,7 @@ func (a *compiler) compileArrayLen(b *block, expr ast.Expr) (int64, bool) {
                return 0, false;
        }
 
-       switch _ := lenExpr.t.lit().(type) {
+       switch lenExpr.t.lit().(type) {
        case *intType:
                return lenExpr.asInt()(nil), true;
        case *uintType:
index 9e297e4697e26feb91f77e5c7f733c2a8e758f24..d337ea1770e7ad7782573e6522c15017dd042640 100644 (file)
@@ -95,7 +95,7 @@ func (a *expr) asInterface() (func(*Thread) interface{}) {
  */
 
 func (a *expr) genConstant(v Value) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *boolType:
                a.eval = func(t *Thread) bool { return v.(BoolValue).Get(t) }
        case *uintType:
@@ -131,7 +131,7 @@ func (a *expr) genConstant(v Value) {
 
 func (a *expr) genIdentOp(level, index int) {
        a.evalAddr = func(t *Thread) Value { return t.f.Get(level, index) };
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *boolType:
                a.eval = func(t *Thread) bool { return t.f.Get(level, index).(BoolValue).Get(t) }
        case *uintType:
@@ -161,7 +161,7 @@ func (a *expr) genIdentOp(level, index int) {
 
 func (a *expr) genFuncCall(call func(t *Thread) []Value) {
        a.exec = func(t *Thread) { call(t)};
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *boolType:
                a.eval = func(t *Thread) bool { return call(t)[0].(BoolValue).Get(t) }
        case *uintType:
@@ -193,7 +193,7 @@ func (a *expr) genFuncCall(call func(t *Thread) []Value) {
 
 func (a *expr) genValue(vf func(*Thread) Value) {
        a.evalAddr = vf;
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *boolType:
                a.eval = func(t *Thread) bool { return vf(t).(BoolValue).Get(t) }
        case *uintType:
@@ -222,7 +222,7 @@ func (a *expr) genValue(vf func(*Thread) Value) {
 }
 
 func (a *expr) genUnaryOpNeg(v *expr) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *uintType:
                vf := v.asUint();
                a.eval = func(t *Thread) uint64 { v := vf(t); return -v }
@@ -246,7 +246,7 @@ func (a *expr) genUnaryOpNeg(v *expr) {
 }
 
 func (a *expr) genUnaryOpNot(v *expr) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *boolType:
                vf := v.asBool();
                a.eval = func(t *Thread) bool { v := vf(t); return !v }
@@ -256,7 +256,7 @@ func (a *expr) genUnaryOpNot(v *expr) {
 }
 
 func (a *expr) genUnaryOpXor(v *expr) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
        case *uintType:
                vf := v.asUint();
                a.eval = func(t *Thread) uint64 { v := vf(t); return ^v }
@@ -273,7 +273,7 @@ func (a *expr) genUnaryOpXor(v *expr) {
 }
 
 func (a *expr) genBinOpAdd(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -306,7 +306,7 @@ func (a *expr) genBinOpAdd(l, r *expr) {
 }
 
 func (a *expr) genBinOpSub(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -335,7 +335,7 @@ func (a *expr) genBinOpSub(l, r *expr) {
 }
 
 func (a *expr) genBinOpMul(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -364,7 +364,7 @@ func (a *expr) genBinOpMul(l, r *expr) {
 }
 
 func (a *expr) genBinOpQuo(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -393,7 +393,7 @@ func (a *expr) genBinOpQuo(l, r *expr) {
 }
 
 func (a *expr) genBinOpRem(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -413,7 +413,7 @@ func (a *expr) genBinOpRem(l, r *expr) {
 }
 
 func (a *expr) genBinOpAnd(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -433,7 +433,7 @@ func (a *expr) genBinOpAnd(l, r *expr) {
 }
 
 func (a *expr) genBinOpOr(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -453,7 +453,7 @@ func (a *expr) genBinOpOr(l, r *expr) {
 }
 
 func (a *expr) genBinOpXor(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -473,7 +473,7 @@ func (a *expr) genBinOpXor(l, r *expr) {
 }
 
 func (a *expr) genBinOpAndNot(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -493,7 +493,7 @@ func (a *expr) genBinOpAndNot(l, r *expr) {
 }
 
 func (a *expr) genBinOpShl(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -508,7 +508,7 @@ func (a *expr) genBinOpShl(l, r *expr) {
 }
 
 func (a *expr) genBinOpShr(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -523,7 +523,7 @@ func (a *expr) genBinOpShr(l, r *expr) {
 }
 
 func (a *expr) genBinOpLss(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -556,7 +556,7 @@ func (a *expr) genBinOpLss(l, r *expr) {
 }
 
 func (a *expr) genBinOpGtr(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -589,7 +589,7 @@ func (a *expr) genBinOpGtr(l, r *expr) {
 }
 
 func (a *expr) genBinOpLeq(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -622,7 +622,7 @@ func (a *expr) genBinOpLeq(l, r *expr) {
 }
 
 func (a *expr) genBinOpGeq(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *uintType:
                lf := l.asUint();
                rf := r.asUint();
@@ -655,7 +655,7 @@ func (a *expr) genBinOpGeq(l, r *expr) {
 }
 
 func (a *expr) genBinOpEql(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *boolType:
                lf := l.asBool();
                rf := r.asBool();
@@ -704,7 +704,7 @@ func (a *expr) genBinOpEql(l, r *expr) {
 }
 
 func (a *expr) genBinOpNeq(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
        case *boolType:
                lf := l.asBool();
                rf := r.asBool();
@@ -753,7 +753,7 @@ func (a *expr) genBinOpNeq(l, r *expr) {
 }
 
 func genAssign(lt Type, r *expr) (func(lv Value, t *Thread)) {
-       switch _ := lt.lit().(type) {
+       switch lt.lit().(type) {
        case *boolType:
                rf := r.asBool();
                return func(lv Value, t *Thread) { lv.(BoolValue).Set(t, rf(t)) }
index cbb8fd27b39e10d7a54c95c71a97008156727b49..5e7465e3d7a8f1215746dc2ff919a360e463a277 100644 (file)
@@ -181,7 +181,7 @@ func (a *expr) asInterface() (func(*Thread) interface{}) {
  */
 
 func (a *expr) genConstant(v Value) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
 «.repeated section Types»
        case «Repr»:
 «.section IsIdeal»
@@ -198,7 +198,7 @@ func (a *expr) genConstant(v Value) {
 
 func (a *expr) genIdentOp(level, index int) {
        a.evalAddr = func(t *Thread) Value { return t.f.Get(level, index) };
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
 «.repeated section Types»
 «.section IsIdeal»
 «.or»
@@ -213,7 +213,7 @@ func (a *expr) genIdentOp(level, index int) {
 
 func (a *expr) genFuncCall(call func(t *Thread) []Value) {
        a.exec = func(t *Thread) { call(t)};
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
 «.repeated section Types»
 «.section IsIdeal»
 «.or»
@@ -230,7 +230,7 @@ func (a *expr) genFuncCall(call func(t *Thread) []Value) {
 
 func (a *expr) genValue(vf func(*Thread) Value) {
        a.evalAddr = vf;
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
 «.repeated section Types»
 «.section IsIdeal»
 «.or»
@@ -245,7 +245,7 @@ func (a *expr) genValue(vf func(*Thread) Value) {
 
 «.repeated section UnaryOps»
 func (a *expr) genUnaryOp«Name»(v *expr) {
-       switch _ := a.t.lit().(type) {
+       switch a.t.lit().(type) {
 «.repeated section Types»
        case «Repr»:
 «.section IsIdeal»
@@ -265,7 +265,7 @@ func (a *expr) genUnaryOp«Name»(v *expr) {
 «.end»
 «.repeated section BinaryOps»
 func (a *expr) genBinOp«Name»(l, r *expr) {
-       switch _ := l.t.lit().(type) {
+       switch l.t.lit().(type) {
 «.repeated section Types»
        case «Repr»:
 «.section IsIdeal»
@@ -290,7 +290,7 @@ func (a *expr) genBinOp«Name»(l, r *expr) {
 
 «.end»
 func genAssign(lt Type, r *expr) (func(lv Value, t *Thread)) {
-       switch _ := lt.lit().(type) {
+       switch lt.lit().(type) {
 «.repeated section Types»
 «.section IsIdeal»
 «.or»
index dcff93ccb47779591dc28307a3be9196a9651c4c..bdbe98c4c4963ed7a3ed6936aaf69dd9677dec86 100644 (file)
@@ -241,7 +241,7 @@ func (a *typeCompiler) compileMapType(x *ast.MapType) Type {
        }
        // XXX(Spec) The Map types section explicitly lists all types
        // that can be map keys except for function types.
-       switch _ := key.lit().(type) {
+       switch key.lit().(type) {
        case *StructType:
                a.diagAt(x, "map key cannot be a struct type");
                return nil;
index 4eba216bb91716be899e440cbad950606dd58d1c..397da097a89b7302937581f0745ab48082ef1d69 100644 (file)
@@ -129,7 +129,7 @@ func (e *exprCode) Type() Type {
 func (e *exprCode) Run() (Value, os.Error) {
        t := new(Thread);
        t.f = e.w.scope.NewFrame(nil);
-       switch _ := e.e.t.(type) {
+       switch e.e.t.(type) {
        case *idealIntType:
                return &idealIntV{e.e.asIdealInt()()}, nil;
        case *idealFloatType: