aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/exp
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-03-24 23:46:17 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-03-24 23:46:17 +0000
commit8039ca76a5705ae5052b20cee64110c32545c4fc (patch)
tree9319bca77115a32f6a0b5e8bcd651465b14c76da /libgo/go/exp
parent7114321ee4f521ea9fbdd08a4c23b361181f3658 (diff)
downloadgcc-8039ca76a5705ae5052b20cee64110c32545c4fc.zip
gcc-8039ca76a5705ae5052b20cee64110c32545c4fc.tar.gz
gcc-8039ca76a5705ae5052b20cee64110c32545c4fc.tar.bz2
Update to current version of Go library.
From-SVN: r171427
Diffstat (limited to 'libgo/go/exp')
-rw-r--r--libgo/go/exp/eval/stmt.go13
-rw-r--r--libgo/go/exp/eval/stmt_test.go2
-rw-r--r--libgo/go/exp/ogle/cmd.go2
3 files changed, 7 insertions, 10 deletions
diff --git a/libgo/go/exp/eval/stmt.go b/libgo/go/exp/eval/stmt.go
index 5c5d433..f6b7c1c 100644
--- a/libgo/go/exp/eval/stmt.go
+++ b/libgo/go/exp/eval/stmt.go
@@ -287,9 +287,6 @@ func (a *stmtCompiler) compile(s ast.Stmt) {
case *ast.SwitchStmt:
a.compileSwitchStmt(s)
- case *ast.TypeCaseClause:
- notimpl = true
-
case *ast.TypeSwitchStmt:
notimpl = true
@@ -1012,13 +1009,13 @@ func (a *stmtCompiler) compileSwitchStmt(s *ast.SwitchStmt) {
a.diagAt(clause.Pos(), "switch statement must contain case clauses")
continue
}
- if clause.Values == nil {
+ if clause.List == nil {
if hasDefault {
a.diagAt(clause.Pos(), "switch statement contains more than one default case")
}
hasDefault = true
} else {
- ncases += len(clause.Values)
+ ncases += len(clause.List)
}
}
@@ -1030,7 +1027,7 @@ func (a *stmtCompiler) compileSwitchStmt(s *ast.SwitchStmt) {
if !ok {
continue
}
- for _, v := range clause.Values {
+ for _, v := range clause.List {
e := condbc.compileExpr(condbc.block, false, v)
switch {
case e == nil:
@@ -1077,8 +1074,8 @@ func (a *stmtCompiler) compileSwitchStmt(s *ast.SwitchStmt) {
// Save jump PC's
pc := a.nextPC()
- if clause.Values != nil {
- for _ = range clause.Values {
+ if clause.List != nil {
+ for _ = range clause.List {
casePCs[i] = &pc
i++
}
diff --git a/libgo/go/exp/eval/stmt_test.go b/libgo/go/exp/eval/stmt_test.go
index 4a883ef..a8a3e16 100644
--- a/libgo/go/exp/eval/stmt_test.go
+++ b/libgo/go/exp/eval/stmt_test.go
@@ -27,7 +27,7 @@ var stmtTests = []test{
CErr("i, u := 1, 2", atLeastOneDecl),
Val2("i, x := 2, f", "i", 2, "x", 1.0),
// Various errors
- CErr("1 := 2", "left side of := must be a name"),
+ CErr("1 := 2", "expected identifier"),
CErr("c, a := 1, 1", "cannot assign"),
// Unpacking
Val2("x, y := oneTwo()", "x", 1, "y", 2),
diff --git a/libgo/go/exp/ogle/cmd.go b/libgo/go/exp/ogle/cmd.go
index 4f67032..9920ff6 100644
--- a/libgo/go/exp/ogle/cmd.go
+++ b/libgo/go/exp/ogle/cmd.go
@@ -160,7 +160,7 @@ func cmdLoad(args []byte) os.Error {
} else {
fname = parts[0]
}
- tproc, err = proc.ForkExec(fname, parts, os.Environ(), "", []*os.File{os.Stdin, os.Stdout, os.Stderr})
+ tproc, err = proc.StartProcess(fname, parts, &os.ProcAttr{Files: []*os.File{os.Stdin, os.Stdout, os.Stderr}})
if err != nil {
return err
}