1
0
mirror of https://github.com/golang/go synced 2024-11-23 21:00:06 -07:00

Revert "go/scanner, go/token: recognize => (ALIAS) token"

This reverts commit 776a90100f.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: Icb451a122c661ded05d9293356b466fa72b965f3
Reviewed-on: https://go-review.googlesource.com/32824
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-11-04 16:11:48 -07:00
parent 2808f1f415
commit a1a688fa00
3 changed files with 2 additions and 9 deletions

View File

@ -735,7 +735,7 @@ scanAgain:
case '>':
tok = s.switch4(token.GTR, token.GEQ, '>', token.SHR, token.SHR_ASSIGN)
case '=':
tok = s.switch3(token.ASSIGN, token.EQL, '>', token.ALIAS)
tok = s.switch2(token.ASSIGN, token.EQL)
case '!':
tok = s.switch2(token.NOT, token.NEQ)
case '&':

View File

@ -121,7 +121,6 @@ var tokens = [...]elt{
{token.LAND, "&&", operator},
{token.LOR, "||", operator},
{token.ARROW, "<-", operator},
{token.ALIAS, "=>", operator},
{token.INC, "++", operator},
{token.DEC, "--", operator},

View File

@ -121,10 +121,6 @@ const (
TYPE
VAR
keyword_end
// Alias support - must add at end to pass Go 1 compatibility test
ALIAS // =>
)
var tokens = [...]string{
@ -225,8 +221,6 @@ var tokens = [...]string{
SWITCH: "switch",
TYPE: "type",
VAR: "var",
ALIAS: "=>",
}
// String returns the string corresponding to the token tok.
@ -306,7 +300,7 @@ func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < literal_en
// IsOperator returns true for tokens corresponding to operators and
// delimiters; it returns false otherwise.
//
func (tok Token) IsOperator() bool { return operator_beg < tok && tok < operator_end || tok == ALIAS }
func (tok Token) IsOperator() bool { return operator_beg < tok && tok < operator_end }
// IsKeyword returns true for tokens corresponding to keywords;
// it returns false otherwise.