[dev.cc] cmd/internal/gc: reconvert to pick up bug fixes

Convert using rsc.io/c2go rev a97ff47.

Notable changes:
- %% in format string now correctly preserved
- reintroduce "signal handler" to hide internal faults
  after errors have been printed

Change-Id: Ic5a94f1c3a8015a9054e21c8969b52d964a36c45
Reviewed-on: https://go-review.googlesource.com/5633
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/src/cmd/internal/gc/subr.go b/src/cmd/internal/gc/subr.go
index c8e613c..dba7dc3 100644
--- a/src/cmd/internal/gc/subr.go
+++ b/src/cmd/internal/gc/subr.go
@@ -36,7 +36,8 @@
 }
 
 func parserline() int {
-	if yychar_subr != 0 && yychar_subr != -2 { // parser has one symbol lookahead
+	if parsing && theparser.Lookahead() > 0 {
+		// parser has one symbol lookahead
 		return int(prevlineno)
 	}
 	return int(lineno)
@@ -135,6 +136,9 @@
 func Yyerror(fmt_ string, args ...interface{}) {
 	var i int
 
+	if fmt_ == "%s" && len(args) == 1 && args[0] == "syntax error" {
+		nsyntaxerrors++
+	}
 	if strings.HasPrefix(fmt_, "syntax error") {
 		nsyntaxerrors++