summaryrefslogtreecommitdiff
path: root/src/cmd/gc/go.errors
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-09-13 13:13:40 +0200
committerOndřej Surý <ondrej@sury.org>2011-09-13 13:13:40 +0200
commit5ff4c17907d5b19510a62e08fd8d3b11e62b431d (patch)
treec0650497e988f47be9c6f2324fa692a52dea82e1 /src/cmd/gc/go.errors
parent80f18fc933cf3f3e829c5455a1023d69f7b86e52 (diff)
downloadgolang-5ff4c17907d5b19510a62e08fd8d3b11e62b431d.tar.gz
Imported Upstream version 60upstream/60
Diffstat (limited to 'src/cmd/gc/go.errors')
-rw-r--r--src/cmd/gc/go.errors70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/cmd/gc/go.errors b/src/cmd/gc/go.errors
new file mode 100644
index 000000000..b5af4678c
--- /dev/null
+++ b/src/cmd/gc/go.errors
@@ -0,0 +1,70 @@
+// 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.
+
+// Example-based syntax error messages.
+// See bisonerrors, Makefile, go.y.
+
+static struct {
+ int yystate;
+ int yychar;
+ char *msg;
+} yymsg[] = {
+ // Each line of the form % token list
+ // is converted by bisonerrors into the yystate and yychar caused
+ // by that token list.
+
+ % loadsys package LIMPORT '(' LLITERAL import_package import_there ','
+ "unexpected comma during import block",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
+ "unexpected semicolon or newline before {",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';'
+ "unexpected semicolon or newline before {",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';'
+ "unexpected semicolon or newline before {",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY
+ "unexpected semicolon or newline before {",
+
+ % loadsys package imports LFUNC LNAME '(' ')' ';' '{'
+ "unexpected semicolon or newline before {",
+
+ % loadsys package imports LTYPE LNAME ';'
+ "unexpected semicolon or newline in type declaration",
+
+ % loadsys package imports LCHAN '}'
+ "unexpected } in channel type",
+
+ % loadsys package imports LCHAN ')'
+ "unexpected ) in channel type",
+
+ % loadsys package imports LCHAN ','
+ "unexpected comma in channel type",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE
+ "unexpected semicolon or newline before else",
+
+ % loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME
+ "name list not allowed in interface type",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME
+ "var declaration not allowed in for initializer",
+
+ % loadsys package imports LVAR LNAME '[' ']' LNAME '{'
+ "unexpected { at end of statement",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{'
+ "unexpected { at end of statement",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LDEFER LNAME ';'
+ "argument to go/defer must be function call",
+
+ % loadsys package imports LVAR LNAME '=' LNAME '{' LNAME ';'
+ "need trailing comma before newline in composite literal",
+
+ % loadsys package imports LFUNC LNAME '(' ')' '{' LFUNC LNAME
+ "nested func not allowed",
+};