github.com/bgentry/go@v0.0.0-20150121062915-6cf5a733d54d/src/cmd/gc/go.errors (about)

     1  // Copyright 2010 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Example-based syntax error messages.
     6  // See bisonerrors, Makefile, go.y.
     7  
     8  static struct {
     9  	int yystate;
    10  	int yychar;
    11  	char *msg;
    12  } yymsg[] = {
    13  	// Each line of the form % token list
    14  	// is converted by bisonerrors into the yystate and yychar caused
    15  	// by that token list.
    16  
    17  	% loadsys package LIMPORT '(' LLITERAL import_package import_there ','
    18  	"unexpected comma during import block",
    19  
    20  	% loadsys package LIMPORT LNAME ';'
    21  	"missing import path; require quoted string",
    22  
    23  	% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';'
    24  	"missing { after if clause",
    25  
    26  	% loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';'
    27  	"missing { after switch clause",
    28  
    29  	% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';'
    30  	"missing { after for clause",
    31  
    32  	% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY
    33  	"missing { after for clause",
    34  
    35  	% loadsys package imports LFUNC LNAME '(' ')' ';' '{'
    36  	"unexpected semicolon or newline before {",
    37  
    38  	% loadsys package imports LTYPE LNAME ';'
    39  	"unexpected semicolon or newline in type declaration",
    40  
    41  	% loadsys package imports LCHAN '}'
    42  	"unexpected } in channel type",
    43  	
    44  	% loadsys package imports LCHAN ')'
    45  	"unexpected ) in channel type",
    46  	
    47  	% loadsys package imports LCHAN ','
    48  	"unexpected comma in channel type",
    49  
    50  	% loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE
    51  	"unexpected semicolon or newline before else",
    52  
    53  	% loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME
    54  	"name list not allowed in interface type",
    55  
    56  	% loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME
    57  	"var declaration not allowed in for initializer",
    58  
    59  	% loadsys package imports LVAR LNAME '[' ']' LNAME '{'
    60  	"unexpected { at end of statement",
    61  
    62  	% loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{'
    63  	"unexpected { at end of statement",
    64  	
    65  	% loadsys package imports LFUNC LNAME '(' ')' '{' LDEFER LNAME ';'
    66  	"argument to go/defer must be function call",
    67  	
    68  	% loadsys package imports LVAR LNAME '=' LNAME '{' LNAME ';'
    69  	"need trailing comma before newline in composite literal",
    70  	
    71  	% loadsys package imports LVAR LNAME '=' comptype '{' LNAME ';'
    72  	"need trailing comma before newline in composite literal",
    73  	
    74  	% loadsys package imports LFUNC LNAME '(' ')' '{' LFUNC LNAME
    75  	"nested func not allowed",
    76  
    77  	% loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header loop_body LELSE ';'
    78  	"else must be followed by if or statement block"
    79  };