def is_value
import bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend as DeepCallInForkimport Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
150# Whether `x`, the node at `at` under `parent`, is a value of a fork, or of a let just before one: not a binder, nor the
151# rest of the block.
152def is_value(x: Lint.Node, +parent: Lint.Node, at: U32) -> Bool:
153 match x parent:
154 case Lint.Node{s, n, sp, k, f} Lint.Node{ps, pn, psp, +kids, pf}:
155 leads([parent], False{}, Bool.not(is_pattern(s)) && Bool.not(is_last(kids, at)))