Eager.work.hot: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/eager.bend as Eager Lines 69-82 of bolt@1.27.0.0/src/rules/suspicious/eager.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/suspicious/eager.bend&start_line=69&end_line=82 import Base import bolt@1.27.0.0/src/syntax/lex.bend as Lex # the hot a leaf leaves behind: a `=>` clears it for the lambda's body; a # comma of a pick's own group moves to its next argument, hot from the third # on (0 the type, 1 the condition, 2 and 3 the branches), and a comma of any # other group returns it to keep; any other leaf leaves it as it was def work.hot(kk: Lex.TokKind, +hot: Bool, +seg: U32, +keep: Bool) -> Bool: match kk: case Lex.TLam{}: False{} case Lex.TComma{}: +in_pick = U32.is_lt(seg, 9) +next = Bool.pick(U32, in_pick, (seg + 1 : U32), seg) Bool.pick(Bool, in_pick, Bool.not(U32.is_lt(next, 2)), keep) case other: hot Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=TokKind