OSDN Git Service

Update Go library to r60.
[pf3gnuchains/gcc-fork.git] / libgo / go / go / types / const.go
index 6fdc22f..1ef95d9 100644 (file)
@@ -12,7 +12,6 @@ import (
        "strconv"
 )
 
-
 // TODO(gri) Consider changing the API so Const is an interface
 //           and operations on consts don't have to type switch.
 
@@ -28,20 +27,17 @@ type Const struct {
        val interface{}
 }
 
-
 // Representation of complex values.
 type cmplx struct {
        re, im *big.Rat
 }
 
-
 func assert(cond bool) {
        if !cond {
                panic("go/types internal error: assertion failed")
        }
 }
 
-
 // MakeConst makes an ideal constant from a literal
 // token and the corresponding literal string.
 func MakeConst(tok token.Token, lit string) Const {
@@ -75,14 +71,12 @@ func MakeConst(tok token.Token, lit string) Const {
        panic("unreachable")
 }
 
-
 // MakeZero returns the zero constant for the given type.
 func MakeZero(typ *Type) Const {
        // TODO(gri) fix this
        return Const{0}
 }
 
-
 // Match attempts to match the internal constant representations of x and y.
 // If the attempt is successful, the result is the values of x and y,
 // if necessary converted to have the same internal representation; otherwise
@@ -132,7 +126,6 @@ func (x Const) Match(y Const) (u, v Const) {
        return
 }
 
-
 // Convert attempts to convert the constant x to a given type.
 // If the attempt is successful, the result is the new constant;
 // otherwise the result is invalid.
@@ -148,7 +141,6 @@ func (x Const) Convert(typ *Type) Const {
        return x
 }
 
-
 func (x Const) String() string {
        switch x := x.val.(type) {
        case bool:
@@ -169,12 +161,10 @@ func (x Const) String() string {
        panic("unreachable")
 }
 
-
 func (x Const) UnaryOp(op token.Token) Const {
        panic("unimplemented")
 }
 
-
 func (x Const) BinaryOp(op token.Token, y Const) Const {
        var z interface{}
        switch x := x.val.(type) {
@@ -194,7 +184,6 @@ func (x Const) BinaryOp(op token.Token, y Const) Const {
        return Const{z}
 }
 
-
 func binaryBoolOp(x bool, op token.Token, y bool) interface{} {
        switch op {
        case token.EQL:
@@ -205,7 +194,6 @@ func binaryBoolOp(x bool, op token.Token, y bool) interface{} {
        panic("unreachable")
 }
 
-
 func binaryIntOp(x *big.Int, op token.Token, y *big.Int) interface{} {
        var z big.Int
        switch op {
@@ -247,7 +235,6 @@ func binaryIntOp(x *big.Int, op token.Token, y *big.Int) interface{} {
        panic("unreachable")
 }
 
-
 func binaryFloatOp(x *big.Rat, op token.Token, y *big.Rat) interface{} {
        var z big.Rat
        switch op {
@@ -275,7 +262,6 @@ func binaryFloatOp(x *big.Rat, op token.Token, y *big.Rat) interface{} {
        panic("unreachable")
 }
 
-
 func binaryCmplxOp(x cmplx, op token.Token, y cmplx) interface{} {
        a, b := x.re, x.im
        c, d := y.re, y.im
@@ -325,7 +311,6 @@ func binaryCmplxOp(x cmplx, op token.Token, y cmplx) interface{} {
        panic("unreachable")
 }
 
-
 func binaryStringOp(x string, op token.Token, y string) interface{} {
        switch op {
        case token.ADD: