def top

bend-lint-api@0.2.0.0 · linter/lint.bend:366

import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import 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)

Uses (3)

Used by (2)