obj.Flagcount("live", "debug liveness analysis", &debuglive)
obj.Flagcount("m", "print optimization decisions", &Debug['m'])
flag.BoolVar(&flag_msan, "msan", false, "build code compatible with C/C++ memory sanitizer")
- flag.BoolVar(&flag_newparser, "newparser", false, "use new parser")
+ flag.BoolVar(&flag_newparser, "newparser", true, "use new parser")
flag.BoolVar(&nolocalimports, "nolocalimports", false, "reject local (relative) imports")
flag.StringVar(&outfile, "o", "", "write output to `file`")
flag.StringVar(&myimportpath, "p", "", "set expected package import `path`")
l = append(l, n)
}
+ p.lineno(expr)
n := p.nod(expr, OTSTRUCT, nil, nil)
n.List.Set(l)
return n
switch cmd {
case "skip", "compiledir":
continue // ignore this file
- // TODO(mdempsky): Remove -newparser=0 case once
- // test/fixedbugs/issue11610.go is updated.
- case "errorcheck", "errorcheck -newparser=0":
+ case "errorcheck":
expectErrors = true
}
}
-// errorcheck -newparser=1
+// errorcheck
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
-// errorcheck -newparser=0
+// errorcheck
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// Test an internal compiler error on ? symbol in declaration
// following an empty import.
-// TODO(mdempsky): Update for new parser. New parser recovers more
-// gracefully and doesn't trigger the "cannot declare name" error.
-// Also remove "errorcheck -newparser=0" case in go/types.TestStdFixed.
-
package a
import"" // ERROR "import path is empty"
var? // ERROR "illegal character U\+003F '\?'"
-var x int // ERROR "unexpected var" "cannot declare name"
+var x int // ERROR "unexpected var"
func main() {
}
-// errorcheckoutput -newparser=0
+// errorcheckoutput
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// Test source files and strings containing NUL and invalid UTF-8.
-// TODO(mdempsky): Update error expectations for -newparser=1. The new
-// lexer skips over NUL and invalid UTF-8 sequences, so they don't emit
-// "illegal character" or "invalid identifier character" errors.
-
package main
import (
/* in other comment ` + "\x00" + ` */ // ERROR "NUL"
-/* in source code */ ` + "\x00" + `// ERROR "NUL" "illegal character"
+/* in source code */ ` + "\x00" + `// ERROR "NUL"
var xx = "in string ` + "\xc2\xff" + `" // ERROR "UTF-8"
/* in other comment ` + "\xe0\x00\x00" + ` */ // ERROR "UTF-8|NUL"
/* in variable name */
-var z` + "\xc1\x81" + ` int // ERROR "UTF-8" "invalid identifier character"
+var z` + "\xc1\x81" + ` int // ERROR "UTF-8"
-/* in source code */ ` + "var \xc2A int" + `// ERROR "UTF-8" "invalid identifier character"
+/* in source code */ ` + "var \xc2A int" + `// ERROR "UTF-8"
`)
}
-// errorcheck -newparser=0
+// errorcheck
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// TODO(mdempsky): Update for new parser or delete.
-// Like go/parser, the new parser doesn't specially recognize
-// send statements misused in an expression context.
-
package main
var c chan int
var v int
func main() {
- if c <- v { // ERROR "used as value"
+ if c <- v { // ERROR "used as value|missing condition|invalid condition"
}
}
-var _ = c <- v // ERROR "used as value"
+var _ = c <- v // ERROR "used as value|unexpected <-"
-// errorcheck -newparser=0
+// errorcheck
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
func main() {
for x // GCCGO_ERROR "undefined"
{ // ERROR "missing .*{.* after for clause|missing operand"
- z // GCCGO_ERROR "undefined"
+ z // ERROR "undefined|missing { after for clause"