Strict.walk: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/pedantic/strict.bend as Strict Lines 89-116 of bolt@1.27.0.0/src/rules/pedantic/strict.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/pedantic/strict.bend&start_line=89&end_line=116 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 # the self-calls in operands: outer is whether the enclosing group is an # operand, hot whether the current comma segment is; a `=>` starts a lambda # body, hot only by its own `&&`/`||`. A leaf is read by its kind in `leaf`, # once the cell after it is known def walk(nn: Tree.Node, +name: String, +path: String, +outer: Bool, +hot: Bool) -> List<&2, F.Finding>: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{k, +t, +l, +c}}, +rest}: match rest: case Tree.NCons{Tree.Group{Lex.Tok{_, +o, _, _}, +kids, _}, r2}: leaf(k, _u => walk(rest, name, path, outer, Bool.or(outer, seg_op(rest))), _v => walk(rest, name, path, outer, seg_op(rest)), _w => call(t, l, c, o, name, path, hot, walk(kids, name, path, inner(hot, o, t), Bool.or(inner(hot, o, t), seg_op(kids))), walk(r2, name, path, outer, hot))) case _r: leaf(k, _u => walk(rest, name, path, outer, Bool.or(outer, seg_op(rest))), _v => walk(rest, name, path, outer, seg_op(rest)), _w => walk(rest, name, path, outer, hot)) case Tree.NCons{Tree.Group{open, +kids, close}, rest}: List.concat(&2, F.Finding, [walk(kids, name, path, hot, Bool.or(hot, seg_op(kids))), walk(rest, name, path, outer, hot)]) case Tree.NCons{Tree.Stmt{kind, +kids, body}, rest}: List.concat(&2, F.Finding, [walk(kids, name, path, False{}, seg_op(kids)), walk(body, name, path, False{}, False{}), walk(rest, name, path, outer, hot)]) case Tree.NCons{h, rest}: walk(rest, name, path, outer, hot) case other: Nil{} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/finding.bend&name=Finding https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/strict.bend&name=call https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/strict.bend&name=inner https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/strict.bend&name=leaf https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/rules/pedantic/strict.bend&name=seg_op https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node