Add Token.KeyFoo constants.

This commit is contained in:
Nigel Tao committed 2017-05-18 16:04:26 +10:00
1 parent 05a217e8a3
commit 90c5f4758e
8 files changed
+483 -358

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ func (n *Expr) Eq(o *Expr) bool {
return false
}
if n.id0 == t.IDXBinaryAs {
if n.id0.Key() == t.KeyXBinaryAs {
if !n.rhs.TypeExpr().Eq(o.rhs.TypeExpr()) {
return false
}
@@ -75,7 +75,7 @@ func (n *TypeExpr) eq(o *TypeExpr, ignoreRefinements bool) bool {
if n.id0 != o.id0 || n.id1 != o.id1 {
return false
}
if n.id0 == t.IDOpenBracket || !ignoreRefinements {
if n.id0.Key() == t.KeyOpenBracket || !ignoreRefinements {
if !n.lhs.Expr().Eq(o.lhs.Expr()) || !n.mhs.Expr().Eq(o.mhs.Expr()) {
return false
}