IC: first steps towards 'nim check --def --ic:on' (#17714)

* IC: first steps towards 'nim check --def --ic:on'
* IC navigator: deduplicate output lines
* IC navigator: progress
* IC navigator: use a different nimcache entry
* IC navigator: special logic for templates/macros
* IC navigator: proper error messages
* IC navigator: prepare for testing code; document only what currently works somewhat
This commit is contained in:
Andreas Rumpf 2021-04-14 16:44:37 +02:00 • committed by GitHub
commit 67e28c07f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 211 additions and 12 deletions

View file

@ -258,9 +258,9 @@ iterator sonsWithoutLast2*(tree: PackedTree; n: NodePos): NodePos =
proc parentImpl(tree: PackedTree; n: NodePos): NodePos =
# finding the parent of a node is rather easy:
var pos = n.int - 1
while pos >= 0 and isAtom(tree, pos) or (pos + tree.nodes[pos].operand - 1 < n.int):
while pos >= 0 and (isAtom(tree, pos) or (pos + tree.nodes[pos].operand - 1 < n.int)):
dec pos
assert pos >= 0, "node has no parent"
#assert pos >= 0, "node has no parent"
result = NodePos(pos)
template parent*(n: NodePos): NodePos = parentImpl(tree, n)