2010-01-27 00:13:22 -07:00
|
|
|
// 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.
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package LIMPORT '(' LLITERAL import_package import_there ','
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected comma during import block",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before {",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';'
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before {",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';'
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before {",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before {",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' ';' '{'
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before {",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LTYPE LNAME ';'
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline in type declaration",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE
|
2010-01-28 16:57:44 -07:00
|
|
|
"unexpected semicolon or newline before else",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME
|
|
|
|
"name list not allowed in interface type",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
2010-01-27 00:13:22 -07:00
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME
|
|
|
|
"var declaration not allowed in for initializer",
|
2010-03-25 13:47:43 -06:00
|
|
|
|
|
|
|
% loadsys package imports LVAR LNAME '[' ']' LNAME '{'
|
|
|
|
"var declaration missing = before initial value",
|
|
|
|
|
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{'
|
|
|
|
"var declaration missing = before initial value",
|
2010-04-05 00:27:26 -06:00
|
|
|
|
|
|
|
% loadsys package imports LFUNC LNAME '(' ')' '{' LDEFER LNAME ';'
|
|
|
|
"argument to go/defer must be function call",
|
2010-05-03 16:02:32 -06:00
|
|
|
|
|
|
|
% 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",
|
2010-01-27 00:13:22 -07:00
|
|
|
};
|