mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Check "b = not true".
This commit is contained in:
1 parent
5d51c6c42c
commit
0e59b05432
4 files changed
+56
-18
No files matched your search
+8
-2
@@ -140,8 +140,11 @@ var opStrings = [256]string{
|
||||
// node, including the sum nodes, has a ConstValue), both sums will have the
|
||||
// same value and will compare equal.
|
||||
func (n *Expr) Eq(o *Expr) bool {
|
||||
if n == o {
|
||||
return true
|
||||
}
|
||||
if n == nil || o == nil {
|
||||
return n == nil && o == nil
|
||||
return false
|
||||
}
|
||||
if n.constValue != nil && o.constValue != nil {
|
||||
return n.constValue.Cmp(o.constValue) == 0
|
||||
@@ -201,8 +204,11 @@ func (n *TypeExpr) String(m *t.IDMap) string {
|
||||
// Eq returns whether n and o are equal.
|
||||
func (n *TypeExpr) Eq(o *TypeExpr) bool {
|
||||
for {
|
||||
if n == o {
|
||||
return true
|
||||
}
|
||||
if n == nil || o == nil {
|
||||
return n == nil && o == nil
|
||||
return false
|
||||
}
|
||||
if n.id0 != o.id0 || n.id1 != o.id1 ||
|
||||
!n.lhs.Expr().Eq(o.lhs.Expr()) ||
|
||||
|
||||
Reference in new issue
Block a user