Commit 0c9f3e49 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/internal/gc: destutter array initializers

Aside from removing the superfluous comment near syms, this diff is
entirely mechanically generated via Emacs's query-replace-regexp to
replace "^\tstruct {\n[^}]*}" with "\t".

Change-Id: Ide7e4b5995f6a121b3f57415e033933ac5c7431a
Reviewed-on: https://go-review.googlesource.com/8427Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent c45f4b71
......@@ -2063,369 +2063,67 @@ var syms = []struct {
etype int
op int
}{
/* name lexical etype op
*/
/* basic types */
struct {
name string
lexical int
etype int
op int
}{"int8", LNAME, TINT8, OXXX},
struct {
name string
lexical int
etype int
op int
}{"int16", LNAME, TINT16, OXXX},
struct {
name string
lexical int
etype int
op int
}{"int32", LNAME, TINT32, OXXX},
struct {
name string
lexical int
etype int
op int
}{"int64", LNAME, TINT64, OXXX},
struct {
name string
lexical int
etype int
op int
}{"uint8", LNAME, TUINT8, OXXX},
struct {
name string
lexical int
etype int
op int
}{"uint16", LNAME, TUINT16, OXXX},
struct {
name string
lexical int
etype int
op int
}{"uint32", LNAME, TUINT32, OXXX},
struct {
name string
lexical int
etype int
op int
}{"uint64", LNAME, TUINT64, OXXX},
struct {
name string
lexical int
etype int
op int
}{"float32", LNAME, TFLOAT32, OXXX},
struct {
name string
lexical int
etype int
op int
}{"float64", LNAME, TFLOAT64, OXXX},
struct {
name string
lexical int
etype int
op int
}{"complex64", LNAME, TCOMPLEX64, OXXX},
struct {
name string
lexical int
etype int
op int
}{"complex128", LNAME, TCOMPLEX128, OXXX},
struct {
name string
lexical int
etype int
op int
}{"bool", LNAME, TBOOL, OXXX},
struct {
name string
lexical int
etype int
op int
}{"string", LNAME, TSTRING, OXXX},
struct {
name string
lexical int
etype int
op int
}{"any", LNAME, TANY, OXXX},
struct {
name string
lexical int
etype int
op int
}{"break", LBREAK, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"case", LCASE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"chan", LCHAN, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"const", LCONST, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"continue", LCONTINUE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"default", LDEFAULT, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"else", LELSE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"defer", LDEFER, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"fallthrough", LFALL, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"for", LFOR, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"func", LFUNC, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"go", LGO, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"goto", LGOTO, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"if", LIF, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"import", LIMPORT, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"interface", LINTERFACE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"map", LMAP, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"package", LPACKAGE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"range", LRANGE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"return", LRETURN, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"select", LSELECT, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"struct", LSTRUCT, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"switch", LSWITCH, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"type", LTYPE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"var", LVAR, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"append", LNAME, Txxx, OAPPEND},
struct {
name string
lexical int
etype int
op int
}{"cap", LNAME, Txxx, OCAP},
struct {
name string
lexical int
etype int
op int
}{"close", LNAME, Txxx, OCLOSE},
struct {
name string
lexical int
etype int
op int
}{"complex", LNAME, Txxx, OCOMPLEX},
struct {
name string
lexical int
etype int
op int
}{"copy", LNAME, Txxx, OCOPY},
struct {
name string
lexical int
etype int
op int
}{"delete", LNAME, Txxx, ODELETE},
struct {
name string
lexical int
etype int
op int
}{"imag", LNAME, Txxx, OIMAG},
struct {
name string
lexical int
etype int
op int
}{"len", LNAME, Txxx, OLEN},
struct {
name string
lexical int
etype int
op int
}{"make", LNAME, Txxx, OMAKE},
struct {
name string
lexical int
etype int
op int
}{"new", LNAME, Txxx, ONEW},
struct {
name string
lexical int
etype int
op int
}{"panic", LNAME, Txxx, OPANIC},
struct {
name string
lexical int
etype int
op int
}{"print", LNAME, Txxx, OPRINT},
struct {
name string
lexical int
etype int
op int
}{"println", LNAME, Txxx, OPRINTN},
struct {
name string
lexical int
etype int
op int
}{"real", LNAME, Txxx, OREAL},
struct {
name string
lexical int
etype int
op int
}{"recover", LNAME, Txxx, ORECOVER},
struct {
name string
lexical int
etype int
op int
}{"notwithstanding", LIGNORE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"thetruthofthematter", LIGNORE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"despiteallobjections", LIGNORE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"whereas", LIGNORE, Txxx, OXXX},
struct {
name string
lexical int
etype int
op int
}{"insofaras", LIGNORE, Txxx, OXXX},
{"int8", LNAME, TINT8, OXXX},
{"int16", LNAME, TINT16, OXXX},
{"int32", LNAME, TINT32, OXXX},
{"int64", LNAME, TINT64, OXXX},
{"uint8", LNAME, TUINT8, OXXX},
{"uint16", LNAME, TUINT16, OXXX},
{"uint32", LNAME, TUINT32, OXXX},
{"uint64", LNAME, TUINT64, OXXX},
{"float32", LNAME, TFLOAT32, OXXX},
{"float64", LNAME, TFLOAT64, OXXX},
{"complex64", LNAME, TCOMPLEX64, OXXX},
{"complex128", LNAME, TCOMPLEX128, OXXX},
{"bool", LNAME, TBOOL, OXXX},
{"string", LNAME, TSTRING, OXXX},
{"any", LNAME, TANY, OXXX},
{"break", LBREAK, Txxx, OXXX},
{"case", LCASE, Txxx, OXXX},
{"chan", LCHAN, Txxx, OXXX},
{"const", LCONST, Txxx, OXXX},
{"continue", LCONTINUE, Txxx, OXXX},
{"default", LDEFAULT, Txxx, OXXX},
{"else", LELSE, Txxx, OXXX},
{"defer", LDEFER, Txxx, OXXX},
{"fallthrough", LFALL, Txxx, OXXX},
{"for", LFOR, Txxx, OXXX},
{"func", LFUNC, Txxx, OXXX},
{"go", LGO, Txxx, OXXX},
{"goto", LGOTO, Txxx, OXXX},
{"if", LIF, Txxx, OXXX},
{"import", LIMPORT, Txxx, OXXX},
{"interface", LINTERFACE, Txxx, OXXX},
{"map", LMAP, Txxx, OXXX},
{"package", LPACKAGE, Txxx, OXXX},
{"range", LRANGE, Txxx, OXXX},
{"return", LRETURN, Txxx, OXXX},
{"select", LSELECT, Txxx, OXXX},
{"struct", LSTRUCT, Txxx, OXXX},
{"switch", LSWITCH, Txxx, OXXX},
{"type", LTYPE, Txxx, OXXX},
{"var", LVAR, Txxx, OXXX},
{"append", LNAME, Txxx, OAPPEND},
{"cap", LNAME, Txxx, OCAP},
{"close", LNAME, Txxx, OCLOSE},
{"complex", LNAME, Txxx, OCOMPLEX},
{"copy", LNAME, Txxx, OCOPY},
{"delete", LNAME, Txxx, ODELETE},
{"imag", LNAME, Txxx, OIMAG},
{"len", LNAME, Txxx, OLEN},
{"make", LNAME, Txxx, OMAKE},
{"new", LNAME, Txxx, ONEW},
{"panic", LNAME, Txxx, OPANIC},
{"print", LNAME, Txxx, OPRINT},
{"println", LNAME, Txxx, OPRINTN},
{"real", LNAME, Txxx, OREAL},
{"recover", LNAME, Txxx, ORECOVER},
{"notwithstanding", LIGNORE, Txxx, OXXX},
{"thetruthofthematter", LIGNORE, Txxx, OXXX},
{"despiteallobjections", LIGNORE, Txxx, OXXX},
{"whereas", LIGNORE, Txxx, OXXX},
{"insofaras", LIGNORE, Txxx, OXXX},
}
func lexinit() {
......@@ -2675,182 +2373,50 @@ var lexn = []struct {
lex int
name string
}{
struct {
lex int
name string
}{LANDAND, "ANDAND"},
struct {
lex int
name string
}{LANDNOT, "ANDNOT"},
struct {
lex int
name string
}{LASOP, "ASOP"},
struct {
lex int
name string
}{LBREAK, "BREAK"},
struct {
lex int
name string
}{LCASE, "CASE"},
struct {
lex int
name string
}{LCHAN, "CHAN"},
struct {
lex int
name string
}{LCOLAS, "COLAS"},
struct {
lex int
name string
}{LCOMM, "<-"},
struct {
lex int
name string
}{LCONST, "CONST"},
struct {
lex int
name string
}{LCONTINUE, "CONTINUE"},
struct {
lex int
name string
}{LDDD, "..."},
struct {
lex int
name string
}{LDEC, "DEC"},
struct {
lex int
name string
}{LDEFAULT, "DEFAULT"},
struct {
lex int
name string
}{LDEFER, "DEFER"},
struct {
lex int
name string
}{LELSE, "ELSE"},
struct {
lex int
name string
}{LEQ, "EQ"},
struct {
lex int
name string
}{LFALL, "FALL"},
struct {
lex int
name string
}{LFOR, "FOR"},
struct {
lex int
name string
}{LFUNC, "FUNC"},
struct {
lex int
name string
}{LGE, "GE"},
struct {
lex int
name string
}{LGO, "GO"},
struct {
lex int
name string
}{LGOTO, "GOTO"},
struct {
lex int
name string
}{LGT, "GT"},
struct {
lex int
name string
}{LIF, "IF"},
struct {
lex int
name string
}{LIMPORT, "IMPORT"},
struct {
lex int
name string
}{LINC, "INC"},
struct {
lex int
name string
}{LINTERFACE, "INTERFACE"},
struct {
lex int
name string
}{LLE, "LE"},
struct {
lex int
name string
}{LLITERAL, "LITERAL"},
struct {
lex int
name string
}{LLSH, "LSH"},
struct {
lex int
name string
}{LLT, "LT"},
struct {
lex int
name string
}{LMAP, "MAP"},
struct {
lex int
name string
}{LNAME, "NAME"},
struct {
lex int
name string
}{LNE, "NE"},
struct {
lex int
name string
}{LOROR, "OROR"},
struct {
lex int
name string
}{LPACKAGE, "PACKAGE"},
struct {
lex int
name string
}{LRANGE, "RANGE"},
struct {
lex int
name string
}{LRETURN, "RETURN"},
struct {
lex int
name string
}{LRSH, "RSH"},
struct {
lex int
name string
}{LSELECT, "SELECT"},
struct {
lex int
name string
}{LSTRUCT, "STRUCT"},
struct {
lex int
name string
}{LSWITCH, "SWITCH"},
struct {
lex int
name string
}{LTYPE, "TYPE"},
struct {
lex int
name string
}{LVAR, "VAR"},
{LANDAND, "ANDAND"},
{LANDNOT, "ANDNOT"},
{LASOP, "ASOP"},
{LBREAK, "BREAK"},
{LCASE, "CASE"},
{LCHAN, "CHAN"},
{LCOLAS, "COLAS"},
{LCOMM, "<-"},
{LCONST, "CONST"},
{LCONTINUE, "CONTINUE"},
{LDDD, "..."},
{LDEC, "DEC"},
{LDEFAULT, "DEFAULT"},
{LDEFER, "DEFER"},
{LELSE, "ELSE"},
{LEQ, "EQ"},
{LFALL, "FALL"},
{LFOR, "FOR"},
{LFUNC, "FUNC"},
{LGE, "GE"},
{LGO, "GO"},
{LGOTO, "GOTO"},
{LGT, "GT"},
{LIF, "IF"},
{LIMPORT, "IMPORT"},
{LINC, "INC"},
{LINTERFACE, "INTERFACE"},
{LLE, "LE"},
{LLITERAL, "LITERAL"},
{LLSH, "LSH"},
{LLT, "LT"},
{LMAP, "MAP"},
{LNAME, "NAME"},
{LNE, "NE"},
{LOROR, "OROR"},
{LPACKAGE, "PACKAGE"},
{LRANGE, "RANGE"},
{LRETURN, "RETURN"},
{LRSH, "RSH"},
{LSELECT, "SELECT"},
{LSTRUCT, "STRUCT"},
{LSWITCH, "SWITCH"},
{LTYPE, "TYPE"},
{LVAR, "VAR"},
}
var lexname_buf string
......@@ -2869,199 +2435,55 @@ var yytfix = []struct {
have string
want string
}{
struct {
have string
want string
}{"$end", "EOF"},
struct {
have string
want string
}{"LLITERAL", "literal"},
struct {
have string
want string
}{"LASOP", "op="},
struct {
have string
want string
}{"LBREAK", "break"},
struct {
have string
want string
}{"LCASE", "case"},
struct {
have string
want string
}{"LCHAN", "chan"},
struct {
have string
want string
}{"LCOLAS", ":="},
struct {
have string
want string
}{"LCONST", "const"},
struct {
have string
want string
}{"LCONTINUE", "continue"},
struct {
have string
want string
}{"LDDD", "..."},
struct {
have string
want string
}{"LDEFAULT", "default"},
struct {
have string
want string
}{"LDEFER", "defer"},
struct {
have string
want string
}{"LELSE", "else"},
struct {
have string
want string
}{"LFALL", "fallthrough"},
struct {
have string
want string
}{"LFOR", "for"},
struct {
have string
want string
}{"LFUNC", "func"},
struct {
have string
want string
}{"LGO", "go"},
struct {
have string
want string
}{"LGOTO", "goto"},
struct {
have string
want string
}{"LIF", "if"},
struct {
have string
want string
}{"LIMPORT", "import"},
struct {
have string
want string
}{"LINTERFACE", "interface"},
struct {
have string
want string
}{"LMAP", "map"},
struct {
have string
want string
}{"LNAME", "name"},
struct {
have string
want string
}{"LPACKAGE", "package"},
struct {
have string
want string
}{"LRANGE", "range"},
struct {
have string
want string
}{"LRETURN", "return"},
struct {
have string
want string
}{"LSELECT", "select"},
struct {
have string
want string
}{"LSTRUCT", "struct"},
struct {
have string
want string
}{"LSWITCH", "switch"},
struct {
have string
want string
}{"LTYPE", "type"},
struct {
have string
want string
}{"LVAR", "var"},
struct {
have string
want string
}{"LANDAND", "&&"},
struct {
have string
want string
}{"LANDNOT", "&^"},
struct {
have string
want string
}{"LBODY", "{"},
struct {
have string
want string
}{"LCOMM", "<-"},
struct {
have string
want string
}{"LDEC", "--"},
struct {
have string
want string
}{"LINC", "++"},
struct {
have string
want string
}{"LEQ", "=="},
struct {
have string
want string
}{"LGE", ">="},
struct {
have string
want string
}{"LGT", ">"},
struct {
have string
want string
}{"LLE", "<="},
struct {
have string
want string
}{"LLT", "<"},
struct {
have string
want string
}{"LLSH", "<<"},
struct {
have string
want string
}{"LRSH", ">>"},
struct {
have string
want string
}{"LOROR", "||"},
struct {
have string
want string
}{"LNE", "!="},
{"$end", "EOF"},
{"LLITERAL", "literal"},
{"LASOP", "op="},
{"LBREAK", "break"},
{"LCASE", "case"},
{"LCHAN", "chan"},
{"LCOLAS", ":="},
{"LCONST", "const"},
{"LCONTINUE", "continue"},
{"LDDD", "..."},
{"LDEFAULT", "default"},
{"LDEFER", "defer"},
{"LELSE", "else"},
{"LFALL", "fallthrough"},
{"LFOR", "for"},
{"LFUNC", "func"},
{"LGO", "go"},
{"LGOTO", "goto"},
{"LIF", "if"},
{"LIMPORT", "import"},
{"LINTERFACE", "interface"},
{"LMAP", "map"},
{"LNAME", "name"},
{"LPACKAGE", "package"},
{"LRANGE", "range"},
{"LRETURN", "return"},
{"LSELECT", "select"},
{"LSTRUCT", "struct"},
{"LSWITCH", "switch"},
{"LTYPE", "type"},
{"LVAR", "var"},
{"LANDAND", "&&"},
{"LANDNOT", "&^"},
{"LBODY", "{"},
{"LCOMM", "<-"},
{"LDEC", "--"},
{"LINC", "++"},
{"LEQ", "=="},
{"LGE", ">="},
{"LGT", ">"},
{"LLE", "<="},
{"LLT", "<"},
{"LLSH", "<<"},
{"LRSH", ">>"},
{"LOROR", "||"},
{"LNE", "!="},
// spell out to avoid confusion with punctuation in error messages
struct {
have string
want string
}{"';'", "semicolon or newline"},
struct {
have string
want string
}{"','", "comma"},
{"';'", "semicolon or newline"},
{"','", "comma"},
}
func pkgnotused(lineno int, path string, name string) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment