def top
import bend-lint-api@0.2.0.0/linter/lint.bend as Lintimport Base
366# The top-level declaration a node is in: the outermost node above it, or the node itself.
367def top(path: List<&2, Above>, node: Node) -> Node:
368 match path:
369 case Nil{}:
370 node
371 case Con{Above{n, at}, Nil{}}:
372 n
373 case Con{a, rest}:
374 top(rest, node)