mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove dead code
Get rid of residue after removing old parser. Change-Id: I0dace1037d50959071a082c276f9f374eef6edb2 Reviewed-on: https://go-review.googlesource.com/17179 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
9216d3e344
commit
8f931e49f5
2 changed files with 3 additions and 83 deletions
|
|
@ -21,10 +21,6 @@ import (
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var yyprev int
|
|
||||||
|
|
||||||
var yylast int
|
|
||||||
|
|
||||||
var imported_unsafe bool
|
var imported_unsafe bool
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -308,7 +304,6 @@ func Main() {
|
||||||
lexinit()
|
lexinit()
|
||||||
typeinit()
|
typeinit()
|
||||||
lexinit1()
|
lexinit1()
|
||||||
// TODO(rsc): Restore yytinit?
|
|
||||||
|
|
||||||
blockgen = 1
|
blockgen = 1
|
||||||
dclcontext = PEXTERN
|
dclcontext = PEXTERN
|
||||||
|
|
@ -347,7 +342,7 @@ func Main() {
|
||||||
|
|
||||||
imported_unsafe = false
|
imported_unsafe = false
|
||||||
|
|
||||||
yyparse()
|
parse_file()
|
||||||
if nsyntaxerrors != 0 {
|
if nsyntaxerrors != 0 {
|
||||||
errorexit()
|
errorexit()
|
||||||
}
|
}
|
||||||
|
|
@ -972,7 +967,6 @@ const (
|
||||||
LVAR
|
LVAR
|
||||||
LANDAND
|
LANDAND
|
||||||
LANDNOT
|
LANDNOT
|
||||||
LBODY
|
|
||||||
LCOMM
|
LCOMM
|
||||||
LDEC
|
LDEC
|
||||||
LEQ
|
LEQ
|
||||||
|
|
@ -1898,26 +1892,8 @@ func pragcgo(text string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type yy struct{}
|
|
||||||
|
|
||||||
func (yy) Lex(v *yySymType) int {
|
|
||||||
return int(yylex(v))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (yy) Error(msg string) {
|
|
||||||
Yyerror("%s", msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
var parsing bool
|
|
||||||
|
|
||||||
func yyparse() {
|
|
||||||
parsing = true
|
|
||||||
parse_file()
|
|
||||||
parsing = false
|
|
||||||
}
|
|
||||||
|
|
||||||
func yylex(yylval *yySymType) int32 {
|
func yylex(yylval *yySymType) int32 {
|
||||||
lx := int(_yylex(yylval))
|
lx := _yylex(yylval)
|
||||||
|
|
||||||
if curio.nlsemi && lx == EOF {
|
if curio.nlsemi && lx == EOF {
|
||||||
// Treat EOF as "end of line" for the purposes
|
// Treat EOF as "end of line" for the purposes
|
||||||
|
|
@ -1943,11 +1919,7 @@ func yylex(yylval *yySymType) int32 {
|
||||||
curio.nlsemi = false
|
curio.nlsemi = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track last two tokens returned by yylex.
|
return lx
|
||||||
yyprev = yylast
|
|
||||||
|
|
||||||
yylast = lx
|
|
||||||
return int32(lx)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getc() int {
|
func getc() int {
|
||||||
|
|
@ -2533,57 +2505,6 @@ func lexname(lex int) string {
|
||||||
return fmt.Sprintf("LEX-%d", lex)
|
return fmt.Sprintf("LEX-%d", lex)
|
||||||
}
|
}
|
||||||
|
|
||||||
var yytfix = map[string]string{
|
|
||||||
"$end": "EOF",
|
|
||||||
"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
|
|
||||||
"';'": "semicolon or newline",
|
|
||||||
"','": "comma",
|
|
||||||
}
|
|
||||||
|
|
||||||
func pkgnotused(lineno int, path string, name string) {
|
func pkgnotused(lineno int, path string, name string) {
|
||||||
// If the package was imported with a name other than the final
|
// If the package was imported with a name other than the final
|
||||||
// import path element, show it explicitly in the error message.
|
// import path element, show it explicitly in the error message.
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,6 @@ var tokstrings = map[int32]string{
|
||||||
LVAR: "var",
|
LVAR: "var",
|
||||||
LANDAND: "&&",
|
LANDAND: "&&",
|
||||||
LANDNOT: "&^",
|
LANDNOT: "&^",
|
||||||
LBODY: "LBODY", // we should never see this one
|
|
||||||
LCOMM: "<-",
|
LCOMM: "<-",
|
||||||
LDEC: "--",
|
LDEC: "--",
|
||||||
LEQ: "==",
|
LEQ: "==",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue