mirror of
https://github.com/golang/go.git
synced 2025-05-31 23:25:39 +00:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
998b6dd75c
commit
76461c93a1
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user