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