summaryrefslogtreecommitdiff
path: root/src/cmd/gc/go.errors
blob: e29cfff5bd498385b096fc0a9a913b97ad1ca010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// 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",

	% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header loop_body LELSE ';'
	"else must be followed by if or statement block"
};