This reverts commit
776a90100f1f65fcf54dfd3d082d657341bdc323.
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>
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 '&':
{token.LAND, "&&", operator},
{token.LOR, "||", operator},
{token.ARROW, "<-", operator},
- {token.ALIAS, "=>", operator},
{token.INC, "++", operator},
{token.DEC, "--", operator},
TYPE
VAR
keyword_end
-
- // Alias support - must add at end to pass Go 1 compatibility test
-
- ALIAS // =>
)
var tokens = [...]string{
SWITCH: "switch",
TYPE: "type",
VAR: "var",
-
- ALIAS: "=>",
}
// String returns the string corresponding to the token tok.
// 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.