def bound

bolt@1.27.0.0 · src/rules/suspicious/concat.bend:151

import bolt@1.27.0.0/src/rules/suspicious/concat.bend as Concat
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/rules/calls.bend as Calls
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

151# the let a statement's own tokens make, when it binds one plain name with
152# `=`, bare or `+`
153def bound(kids: Tree.Node) -> Maybe<&2, Let>:
154  match kids:
155    case Tree.NCons{+h1, Tree.NCons{+h2, +rest}}:
156      Lazy.either(Maybe<&2, Let>, Calls.kind.leaf(~Calls.kind.oper, h1), _u => bound.plus(h1, h2, rest),
157        _v => bound.named(h1, h2, rest))
158    case other:
159      None{}

Uses (8)

Used by (1)