Commit a1a688fa authored by Robert Griesemer's avatar Robert Griesemer

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

This reverts commit 776a9010.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: Icb451a122c661ded05d9293356b466fa72b965f3
Reviewed-on: https://go-review.googlesource.com/32824Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 2808f1f4
......@@ -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 '&':
......
......@@ -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},
......
......@@ -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.
......
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