This reverts commit bb4b27a2ca.
This commit is contained in:
Andreas Rumpf 2020-11-30 23:36:38 +01:00 • committed by GitHub
commit 2e4b6b94e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 126 deletions

View file

@ -54,21 +54,6 @@ proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool =
strictSymEquality): return
result = true
proc sameLocation*(a, b: PNode): bool =
if a == b: true
elif a == nil or b == nil: false
elif a.kind == b.kind:
case a.kind:
of nkCheckedFieldExpr, nkDerefExpr, nkHiddenDeref,
nkAddr, nkHiddenAddr, nkObjDownConv, nkObjUpConv:
sameLocation(a[0], b[0])
of nkDotExpr, nkBracketExpr:
sameLocation(a[0], b[0]) and sameLocation(a[1], b[1])
of nkHiddenStdConv, nkHiddenSubConv: sameLocation(a[1], b[1])
of nkNone..nkNilLit: exprStructuralEquivalent(a, b, strictSymEquality = true)
else: false
else: false
proc sameTree*(a, b: PNode): bool =
if a == b:
result = true