Commit 76461c93 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile: move lexn and lexname into lex.go (cleanup)

Missed these two declarations in the previous cleanup.

Change-Id: I54ff3accd387dd90e12847daccf4477169797f81
Reviewed-on: https://go-review.googlesource.com/20603
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 998b6dd7
......@@ -137,6 +137,54 @@ const (
LIGNORE
)
var lexn = map[rune]string{
LNAME: "NAME",
LLITERAL: "LITERAL",
LOPER: "OPER",
LASOP: "ASOP",
LINCOP: "INCOP",
LCOLAS: "COLAS",
LCOMM: "COMM",
LDDD: "DDD",
LBREAK: "BREAK",
LCASE: "CASE",
LCHAN: "CHAN",
LCONST: "CONST",
LCONTINUE: "CONTINUE",
LDEFAULT: "DEFAULT",
LDEFER: "DEFER",
LELSE: "ELSE",
LFALL: "FALL",
LFOR: "FOR",
LFUNC: "FUNC",
LGO: "GO",
LGOTO: "GOTO",
LIF: "IF",
LIMPORT: "IMPORT",
LINTERFACE: "INTERFACE",
LMAP: "MAP",
LPACKAGE: "PACKAGE",
LRANGE: "RANGE",
LRETURN: "RETURN",
LSELECT: "SELECT",
LSTRUCT: "STRUCT",
LSWITCH: "SWITCH",
LTYPE: "TYPE",
LVAR: "VAR",
// LIGNORE is never escaping lexer.next
}
func lexname(lex rune) string {
if s, ok := lexn[lex]; ok {
return s
}
return fmt.Sprintf("LEX-%d", lex)
}
func (l *lexer) next() {
nlsemi := l.nlsemi
l.nlsemi = false
......
......@@ -1057,52 +1057,6 @@ func lexfini() {
nodfp.Sym = Lookup(".fp")
}
var lexn = map[rune]string{
LNAME: "NAME",
LLITERAL: "LITERAL",
LOPER: "OPER",
LASOP: "ASOP",
LINCOP: "INCOP",
LCOLAS: "COLAS",
LCOMM: "COMM",
LDDD: "DDD",
LBREAK: "BREAK",
LCASE: "CASE",
LCHAN: "CHAN",
LCONST: "CONST",
LCONTINUE: "CONTINUE",
LDEFAULT: "DEFAULT",
LDEFER: "DEFER",
LELSE: "ELSE",
LFALL: "FALL",
LFOR: "FOR",
LFUNC: "FUNC",
LGO: "GO",
LGOTO: "GOTO",
LIF: "IF",
LIMPORT: "IMPORT",
LINTERFACE: "INTERFACE",
LMAP: "MAP",
LPACKAGE: "PACKAGE",
LRANGE: "RANGE",
LRETURN: "RETURN",
LSELECT: "SELECT",
LSTRUCT: "STRUCT",
LSWITCH: "SWITCH",
LTYPE: "TYPE",
LVAR: "VAR",
}
func lexname(lex rune) string {
if s, ok := lexn[lex]; ok {
return s
}
return fmt.Sprintf("LEX-%d", lex)
}
func pkgnotused(lineno int32, path string, name string) {
// If the package was imported with a name other than the final
// import path element, show it explicitly in the error message.
......
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