def search.call

bolt@1.27.0.0 · src/rules/correctness/pick.bend:264

import bolt@1.27.0.0/src/rules/correctness/pick.bend as Pick
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

264# past the bound name, `=` and the callee: a `(` group and nothing after it,
265# and then the finding the first reader of the name gives
266def search.call(
267  kx: Lex.TokKind,
268  +xx: String,
269  +ee: String,
270  +nn: String,
271  +ll: U32,
272  +cc: U32,
273  r3: Tree.Node,
274  rest: Tree.Node,
275  +name: String,
276  +path: String
277) -> List<&2, F.Finding>:
278  match r3:
279    case Tree.NCons{Tree.Group{Lex.Tok{_ko, +o, _lo, _co}, +args, _cl}, after}:
280      +ok = Bool.and(Bool.and(Lex.is_name(kx), String.eq(ee, "=")),
281        Bool.and(Bool.and(String.eq(nn, name), String.eq(o, "(")), search.empty(after)))
282      Lazy.stop(List<&2, F.Finding>, Bool.not(ok), [],
283        _u => search.judge(search.first(rest, xx, Tree.NNil{}, False{}), xx, args, ll, cc, name, path))
284    case _other:
285      []

Uses (16)

Used by (1)